Standard library / go/parser

go/parser.SkipObjectResolution

Skips deprecated object resolution. Scope and Unresolved are nil. Expected stdout: 'true true\n'.

Formal Syntax & Structure

go syntaxgo
const SkipObjectResolution Mode = 64

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/parser"  "go/token")
func check(e error) {  if e != nil {    panic(e)  }}
func main() {  f, e := parser.ParseFile(token.NewFileSet(), "demo.go", "package demo; var X=1", parser.SkipObjectResolution)  check(e)  fmt.Println(f.Scope == nil, f.Unresolved == nil)}
Go Reference