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
+27.7k PHP : Count number of JSON items/objects
+17.9k Golang : Simple client server example
+12.3k Golang : Display list of countries and ISO codes
+12.3k Golang : Print UTF-8 fonts on image example
+13.6k Golang : Set image canvas or background to transparent
+14.8k Golang : Adding XML attributes to xml data or use attribute to differentiate a common tag name
+15.9k Golang : Read a file line by line
+11.1k Golang : How to determine a prime number?
+13.1k Golang : Convert(cast) uintptr to string example
+21.2k Golang : How to get time zone and load different time zone?
+10.1k Golang : Compare files modify date example
+19.8k Golang : Append content to a file