Standard library / go/ast

go/ast.BadExpr.End()

Returns the stored To position of the malformed expression. Expected stdout: '7\n'.

Formal Syntax & Structure

go syntaxgo
func (x *BadExpr) End() token.Pos

Return Value

token.Pos

Returns the stored To position of the malformed expression.

Working Example

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