Standard library / go/doc
go/doc.IsPredeclared()
Reports whether a name is a predeclared Go identifier. Expected stdout: 'true false\n'.
Formal Syntax & Structure
go syntaxgo
func IsPredeclared(s string) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | string | Shift distance in bits or string content, depending on the function. |
Return Value
bool
Reports whether a name is a predeclared Go identifier.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/doc")
func main() { fmt.Println(doc.IsPredeclared("len"), doc.IsPredeclared("local")) }