Grokking Advanced Go
Vote

0% completed

​

Parsing Go Code with go ast

Output:

0 *ast.BinaryExpr { 1 . X: *ast.SelectorExpr { 2 . . X: *ast.Ident { 3 . . . NamePos: 1 4 . . . Name: "it" 5 . . } 6 . . Sel: *ast.Ident { 7 . . . NamePos: 4 8 . . . Name: "Cents" 9 . . } 10 . } 11 . OpPos: 10 12 . Op: * 13 . Y: *ast.BasicLit { 14 . . ValuePos: 12 15 . . ValueEnd: 13 16 . . Kind: INT 17 . . Value: "2" 18 . } 19 }

The input was twelve characters of text, and the output is a structure of Go values

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content