Standard library / go/constant

go/constant.Bool

Boolean constant category; compare Value.Kind with this constant. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const Bool Kind

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/constant")
func main() { fmt.Println(constant.MakeBool(true).Kind() == constant.Bool) }
Go Reference