Standard library / go/token
go/token.IsExported()
Checks whether a name begins with a Unicode uppercase letter. This is a spelling check, not a scope check. Expected stdout: 'true false\n'.
Formal Syntax & Structure
go syntaxgo
func IsExported(name string) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Identifier spelling to classify. |
Return Value
bool
Checks whether a name begins with a Unicode uppercase letter.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/token")
func main() { fmt.Println(token.IsExported("Name"), token.IsExported("name")) }