Standard library / go/types
go/types.Map.Elem()
Map value type. Expected stdout: 'int\n'.
Formal Syntax & Structure
go syntaxgo
func (m *Map) Elem() TypeReturn Value
Type
Map value 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.Elem()) }