ast (2 articles)

Basic AST Manipulation in Go

10.11.2017 - 5m read - Go Golang ast

Traversing an AST (Abstract Syntax Tree) is useful for analysing and understanding a code-base, but the real power comes when we are able to manipulate it, which allows us to build tools. This post shows a simple example of how to manipulate the AST in Go.


Basic AST Traversal in Go

14.07.2017 - 6m read - Go Golang ast

Looking at and interacting with the AST (Abstract Syntax Tree) of a program can be both interesting and useful for automation. In this post, we'll look at an example of how to parse a Go program to an AST and how to analyse it.