Standard library / go/types

go/types.Array.String()

Returns a diagnostic string representation of the type. Expected stdout: '[3]int\n'.

Formal Syntax & Structure

go syntaxgo
func (a *Array) String() string

Return Value

string

Returns a diagnostic string representation of the type.

Working Example

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