Standard library / go/constant
go/constant.BoolVal()
Extract a boolean constant; Unknown yields false. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func BoolVal(x Value) boolParameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | Value | Input constant or Go value as specified by the function. |
Return Value
bool
Extract a boolean constant; Unknown yields false.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/constant")
func main() { fmt.Println(constant.BoolVal(constant.MakeBool(true))) }