Standard library / go/types

go/types.Map

Represents a Go map type in the semantic model, not a runtime value. Expected stdout: 'map[string]int\n'.

Formal Syntax & Structure

go syntaxgo
type Map struct {}

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) }
Go Reference