Created
December 18, 2017 11:31
-
-
Save campoy/7ea039aa6e8960ef118f5984107d33b3 to your computer and use it in GitHub Desktop.
second gist for https://medium.com/p/c4e88a6edb87/edit Raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"go/parser" | |
"go/token" | |
"log" | |
) | |
func main() { | |
fs := token.NewFileSet() | |
f, err := parser.ParseFile(fs, "", "package main; var a = 3", parser.AllErrors) | |
if err != nil { | |
log.Fatal(err) | |
} | |
fmt.Println(f) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment