Golang AST and types packages
What Overview of how go/ast, go/token, go/types and compilation related packages work. How is it different from reflect. AST (go/ast) The go/ast is the package for abstract syntax tree (AST). Notice the go/ prefix in the path as opposed to a reflection library reflect. The go/ directory contains Go language related packages. The go/ast package contains the nodes types and utility functions. There are some notable interfaces. interfaces in go/ast AST is a tree and ast.Node interface is the fundamental unit of a node in the tree. AST is built from parsing textual code so the Node contains the starting position Pos() and the ending position End() which are of type token.Pos. ...