Predeclared constant

Go true constant

Untyped boolean constant representing truth. Can initialize a boolean or a defined boolean type. Example output: 'true'.

Formal Syntax & Structure

go syntaxgo
true

Working Example

Example Snippetgo
package main
import (  "fmt")
func main() {  const enabled = true  fmt.Println(enabled)}
Go Reference