Standard library / go/ast

go/ast.IsExported()

Reports whether a name begins with an uppercase Unicode letter; it does not validate the entire identifier. Expected stdout: 'true false\n'.

Formal Syntax & Structure

go syntaxgo
func IsExported(name string) bool

Parameters & Attributes

NameTypeDescription
namestringIdentifier spelling.

Return Value

bool

Reports whether a name begins with an uppercase Unicode letter; it does not validate the entire identifier.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/ast")
func main() { fmt.Println(ast.IsExported("Total"), ast.IsExported("total")) }
Go Reference