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
+13k Golang : Calculate elapsed years or months since a date
+7.7k Golang : get the current working directory of a running program
+11.6k Golang : Concurrency and goroutine example
+22.7k Golang : Strings to lowercase and uppercase example
+11.5k Golang : Handle API query by curl with Gorilla Queries example
+7.3k Golang : File system scanning
+8.6k Python : Fix SyntaxError: Non-ASCII character in file, but no encoding declared
+16.6k Golang : Generate QR codes for Google Authenticator App and fix "Cannot interpret QR code" error
+5.4k Golang : Get S3 or CloudFront object or file information
+5.8k Golang : List all packages and search for certain package
+9k Golang : automatically figure out array length(size) with three dots
+18.4k Golang : How to get hour, minute, second from time?