The Go Programming Language Specification
Language specification for syntax, types, declarations, statements, packages, and core semantics.
Language specification for syntax, types, declarations, statements, packages, and core semantics.
- Author: Go Team
- Authority: primary
- Kind: spec
- URL: https://go.dev/ref/spec
What it covers
- language syntax and grammar
- type system rules
- package and declaration semantics
Why authoritative
Canonical language specification published by the Go Team.
Use when
- what does the Go spec require here
- is this valid Go syntax
- how does this Go language rule work
Keywords
- go spec, language semantics, types, syntax, declarations
Used by
- buffered-channels
- build-tags
- channel-closing
- channels
- embedding
- init-functions
- integer-overflow
- maps
- named-result-parameters
- range-loops
- reflection
- select-patterns
- slices
- strings
- type-assertions
- unsafe
- constants-and-iota
- variables-and-short-declarations
- scope-and-blocks
- blank-identifier-and-predeclared-identifiers
- array-types
- struct-types
- pointer-types
- interface-types-and-method-sets
- function-types-literals-and-method-values
- type-identity-and-underlying-types
- assignability-and-representability
- conversions
- composite-literals
- selectors-indexing-and-slicing
- order-of-evaluation
- switch-and-type-switch
- for-statements
- built-in-functions
- package-and-import-semantics
- program-initialization-order
- run-time-panics
- literal-syntax
- semicolons
- errors-as-language-semantics