Golang go/ast.ArrayType type examples

package go/ast

An ArrayType node represents an array or slice type.

Golang go/ast.ArrayType type usage examples

Example 1:

 var n ast.Node

 switch n := n.(type) {
 case *ast.ArrayType:
 fmt.Println("array type")
 }

Example 2:

 expr = &ast.ArrayType{expr.Pos(), nil, expr}

Reference :

http://golang.org/pkg/go/ast/#ArrayType

Advertisement