Skip to content

Instantly share code, notes, and snippets.

@campoy
Created December 18, 2017 11:29
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/16e9bc6b6599c9f4b3a8343c547b7c05 to your computer and use it in GitHub Desktop.
Save campoy/16e9bc6b6599c9f4b3a8343c547b7c05 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, "", "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