Standard library / go/ast
go/ast.BadDecl.Pos()
Returns the stored From position of the malformed declaration. Expected stdout: '3\n'.
Formal Syntax & Structure
go syntaxgo
func (d *BadDecl) Pos() token.PosReturn Value
token.Pos
Returns the stored From position of the malformed declaration.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/ast")
func main() { x := &ast.BadDecl{From: 3, To: 7}; fmt.Println(x.Pos()) }