Fix default case handling in walkChild

A refreshed understanding has been etched in commentary.
This commit is contained in:
Tyler Sommer 2023-04-07 21:59:24 -06:00
parent a8aa579c7f
commit 6a90da394f
No known key found for this signature in database
GPG key ID: C09C010500DBD008
2 changed files with 2 additions and 2 deletions

View file

@ -2,7 +2,6 @@ package stick_test
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"

View file

@ -344,7 +344,8 @@ func (s *state) walkChild(node parse.Node) error {
case *parse.UseNode:
return s.walkUseNode(node)
default:
return fmt.Errorf("walkChild: unsupported Node type: %T (bug?)", node)
// No need to handle other nodes. This function only populates blocks from a
// referenced template (in a use statement) and does not actually execute anything.
}
return nil
}