Position of a node
fset := token.NewFileSet()
file, _ := parser.ParseFile(fset, "x.go", nil, 0)
ast.Inspect(file, func(n ast.Node) bool {
if id, ok := n.(*ast.Ident); ok {
fmt.Println(id.Name, fset.Position(id.Pos()))
}
return true
})