Standard library / go/ast

go/ast.BadDecl

Placeholder for a malformed declaration. Parser recovery can retain these nodes; do not assume recovered source is valid. Expected stdout: '3 7\n'.

Formal Syntax & Structure

go syntaxgo
type BadDecl struct {  From, To token.Pos}

Working Example

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