You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the package text/template/parse to analyze a template ParseTree, it is common to want to visit all Nodes in a tree, even when they are nested in other nodes.
I've implemented a Traverse function that works recursively from a tree root:
Is this something that could be added to text/template/parse as a utility function? I believe that a cleaned up version of this or something similar to the ast.Walk interface could increase the utility of the parse package and open the door for static analysis tooling around go templates.
The text was updated successfully, but these errors were encountered:
When using the package
text/template/parse
to analyze a templateParseTree
, it is common to want to visit allNode
s in a tree, even when they are nested in other nodes.I've implemented a
Traverse
function that works recursively from a tree root:Is this something that could be added to
text/template/parse
as a utility function? I believe that a cleaned up version of this or something similar to theast.Walk
interface could increase the utility of the parse package and open the door for static analysis tooling around go templates.The text was updated successfully, but these errors were encountered: