Golang go/ast.BadStmt.End() and Pos() functions example

package go/ast

Pos and End implementations for statement nodes.

Golang go/ast.BadStmt.End() and Pos() functions usage example

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

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

 }

References :

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

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

Advertisement