Standard library / go/ast

go/ast.BadStmt.Pos()

Returns the stored From position of the malformed statement. Expected stdout: '3\n'.

Formal Syntax & Structure

go syntaxgo
func (s *BadStmt) Pos() token.Pos

Return Value

token.Pos

Returns the stored From position of the malformed statement.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/ast")
func main() { x := &ast.BadStmt{From: 3, To: 7}; fmt.Println(x.Pos()) }
Go Reference