Standard library / go/types

go/types.Nil.Name()

Returns the unqualified declaration name. Expected stdout: 'nil\n'.

Formal Syntax & Structure

go syntaxgo
func (obj *Nil) Name() string

Return Value

string

Returns the unqualified declaration name.

Working Example

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