Standard library / go/types

go/types.IsBoolean

BasicInfo mask for boolean basic types. Test using bitwise AND, not equality. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
const IsBoolean BasicInfo

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { fmt.Println(types.Typ[types.Bool].Info()&types.IsBoolean != 0) }
Go Reference