Skip to content

Instantly share code, notes, and snippets.

@campoy
Created December 18, 2017 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save campoy/7ea039aa6e8960ef118f5984107d33b3 to your computer and use it in GitHub Desktop.
Save campoy/7ea039aa6e8960ef118f5984107d33b3 to your computer and use it in GitHub Desktop.
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