Standard library / go/types

go/types.Nil.Pos()

Returns the declaration identifier position, or NoPos when no source position exists. Expected stdout: 'false\n'.

Formal Syntax & Structure

go syntaxgo
func (obj *Nil) Pos() token.Pos

Return Value

token.Pos

Returns the declaration identifier position, or NoPos when no source position exists.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { v := types.Universe.Lookup("nil").(*types.Nil); fmt.Println(v.Pos().IsValid()) }
Go Reference