Transform Go code into it's AST
echo "a := 1" | go run main.go
[]ast.Stmt {
&ast.AssignStmt {
Lhs: []ast.Expr {
&ast.Ident {
Name: "a",
},
},
Tok: :=,
Rhs: []ast.Expr {
&ast.BasicLit {
ValuePos: 30,
Kind: INT,
Value: "1",
},
},
},
}
Try this live: https://reflog.github.io/go2ast/
👤 Eli Yukelzon