Standard library / flag
flag.Uint64()
Registers a flag on the default command line. Unsigned 64-bit integer; rejects values outside its range. Run with arguments: ["-x=4294967296"]. Expected stdout: '4294967296\n'.
Formal Syntax & Structure
go syntaxgo
func Uint64(name string, value uint64, usage string) *uint64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| name | string | Name of the flag or flag set. |
| value | uint64 | Default value for registration, or text to parse for Set. |
| usage | string | Help text describing the flag. |
Return Value
*uint64
Registers a flag on the default command line.
Working Example
Example Snippetgo
package main
import ( "flag" "fmt")
func main() { v := flag.Uint64("x", 3, "value"); flag.Parse(); fmt.Println(*v) }