Golang go/ast.InterfaceType type example

package go/ast

An InterfaceType node represents an interface type.

Golang go/ast.InterfaceType type usage example

 func NodeDescription(n ast.Node) string {
 switch n := n.(type) {
 case *ast.ArrayType:
 return "array type"
 case *ast.AssignStmt:
 return "assignment"
 case *ast.InterfaceType:
 return "interface type"
 }

Reference :

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

Advertisement