Standard library / flag
flag.Int64Var()
Registers a flag on the default command line. Binds existing int64 storage rather than returning a pointer. Signed 64-bit integer, independent of native int width. Run with arguments: ["-x=4294967296"]. Expected stdout: '4294967296\n'.
Formal Syntax & Structure
go syntaxgo
func Int64Var(p *int64, name string, value int64, usage string)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| p | *int64 | Pointer to storage updated during parsing. |
| name | string | Name of the flag or flag set. |
| value | int64 | Default value for registration, or text to parse for Set. |
| usage | string | Help text describing the flag. |
Working Example
Example Snippetgo
package main
import ( "flag" "fmt")
func main() { var v int64; flag.Int64Var(&v, "x", 3, "value"); flag.Parse(); fmt.Println(v) }