Golang go/ast.IsExported() function example

package go/ast

IsExported reports whether name is an exported Go symbol (that is, whether it begins with an upper-case letter).

Golang go/ast.IsExported() function usage example

 ...
 var vs *ast.ValueSpec
 name := vs.Names[0].Name
 if !ast.IsExported(name) {
 fmt.Println("%s not exported", name)
 }

Reference :

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

Advertisement