Standard library / go/types

go/types.Map.Underlying()

Returns the underlying type. An unnamed composite type is its own underlying type. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (t *Map) Underlying() Type

Return Value

Type

Returns the underlying type.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() {  t := types.NewMap(types.Typ[types.String], types.Typ[types.Int])  fmt.Println(t.Underlying() == t)}
Go Reference