Standard library / go/constant
go/constant.Uint64Val()
Extract uint64 and exactness flag; ignore the result when the flag is false. Expected stdout: '42 true\n'.
Formal Syntax & Structure
go syntaxgo
func Uint64Val(x Value) (uint64, bool)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | Value | Input constant or Go value as specified by the function. |
Return Value
(uint64, bool)
Extract uint64 and exactness flag; ignore the result when the flag is false.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/constant")
func main() { v, ok := constant.Uint64Val(constant.MakeUint64(42)); fmt.Println(v, ok) }