Golang go/ast.AssignStmt.End() function and Pos() function example

package go/ast

Golang go/ast.AssignStmt.End() function and Pos() function usage

 func checkCurrentPosition(node ast.Node) string {
 n := node.(*ast.AssignStmt)
 endpos := n.End()
 pospos := n.Pos()

 if pospos != endpos {
 return "not yet"
 }
  }

References :

http://golang.org/pkg/go/ast/#AssignStmt.End

http://golang.org/pkg/go/ast/#AssignStmt.Pos

Advertisement