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.7k Golang : Load ASN1 encoded DSA public key PEM file example
+7.2k Golang : Dealing with postal or zip code example
+6k Golang : Compound interest over time example
+12.2k Linux : How to install driver for 600Mbps Dual Band Wifi USB Adapter
+22.7k Golang : Strings to lowercase and uppercase example
+4.9k Nginx and PageSpeed build from source CentOS example
+28.2k Golang : Connect to database (MySQL/MariaDB) server
+38.1k Golang : Read a text file and replace certain words
+21.1k Golang : Sort and reverse sort a slice of strings
+5.6k Golang : Configure crontab to poll every two minutes 8am to 6pm Monday to Friday
+10.2k Golang : Find and replace data in all files recursively
+14k Golang : concatenate(combine) strings