Declaration
Typed constants
A typed constant has a fixed type and cannot be reassigned. The initializer must be representable in that type. Assignment to a distinct defined numeric type requires conversion. Example output: 'int64 5'.
Formal Syntax & Structure
go syntaxgo
const Name Type = expressionWorking Example
Example Snippetgo
package main
import "fmt"
func main() { const rate int64 = 5 fmt.Printf("%T %d\n", rate, rate)}