Golang go/ast.Ident type examples

package go/ast

An Ident node represents an identifier.

Golang go/ast.Ident type usage examples

Example 1:

 ...
 switch expr := field.Type.(type) {
 case *ast.Ident:
 switch expr.Name {
 case "bool", "string", "int", "int64", "uint", "uint64":
 kind = expr.Name
 }
 ...

Example 2:

 describeIdent := &ast.Ident{Name: "Describe"}

Reference :

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

Advertisement