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

package go/ast

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

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

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

 }

References :

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

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

Advertisement