Standard library / go/types

go/types.IsConstType

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

Formal Syntax & Structure

go syntaxgo
const IsConstType BasicInfo

Working Example

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