Standard library / go/constant

go/constant.MakeBool()

Create a boolean constant. Expected stdout: 'Bool\n'.

Formal Syntax & Structure

go syntaxgo
func MakeBool(b bool) Value

Parameters & Attributes

NameTypeDescription
bboolBoolean value to represent.

Return Value

Value

Create a boolean constant.

Working Example

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