Golang flag.Uint64Var() function example
package flag
Uint64Var defines a uint64 flag with specified name (2nd parameter), default value (3rd parameter), and usage string (4th parameter). The argument p (1st parameter) points to a uint64 variable in which to store the value of the flag.
Golang flag.Uint64Var() function usage example
package main
import (
"flag"
"fmt"
)
func main() {
var appID uint64
flag.Uint64Var(&appID, "FBAppID", 108, "Facebook Application ID")
flag.Parse()
fmt.Println(flag.Lookup("FBAppID")) // print the Flag struct
fmt.Println(appID)
}
Output :
&{FBAppID Facebook Application ID 108 108}
108
Reference :
Advertisement
Something interesting
Tutorials
+9.6k Golang : Read file with ioutil
+4k Detect if Google Analytics and Developer Media are loaded properly or not
+5.1k Golang : Display packages names during compilation
+6.9k Golang : Calculate BMI and risk category
+7.1k Golang : Transform lisp or spinal case to Pascal case example
+19.1k Mac OSX : Homebrew and Golang
+17.8k Golang : Iterate linked list example
+11.2k Golang : Proper way to test CIDR membership of an IP 4 or 6 address example
+15.4k Golang : invalid character ',' looking for beginning of value
+5.4k Golang : fmt.Println prints out empty data from struct
+20.9k Golang : Underscore or snake_case to camel case example