Golang flag.FlagSet.Int64() function example
package flag
Int64 defines an int64 flag with specified name(1st parameter), default value(2nd parameter), and usage string(3rd parameter). The return value is the address of an int64 variable that stores the value of the flag.
Golang flag.FlagSet.Int64() function usage example
package main
import (
"flag"
"fmt"
)
func main() {
flagSet := flag.NewFlagSet("check", flag.ExitOnError)
hour := flagSet.Int64("diskchecktimeout", 1, "Disk check process time out. Default is 1 hour.")
flag.Parse()
fmt.Println(*hour)
}
Output :
1
Reference :
Advertisement
Something interesting
Tutorials
+18.4k Golang : How to remove certain lines from a file
+31.5k Golang : Example for ECDSA(Elliptic Curve Digital Signature Algorithm) package functions
+9k Golang : Capture text return from exec function example
+3.4k Golang : Fix go-cron set time not working issue
+12.4k Elastic Search : Return all records (higher than default 10)
+9.1k Golang : io.Reader causing panic: runtime error: invalid memory address or nil pointer dereference
+10.8k Golang : Natural string sorting example
+29.7k Golang : Record voice(audio) from microphone to .WAV file
+5.9k Golang : Denco multiplexer example
+13.4k Golang : Verify token from Google Authenticator App
+7.9k Golang : Grayscale Image