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
+12.7k Golang : Add ASCII art to command line application launching process
+29.7k Golang : Record voice(audio) from microphone to .WAV file
+4.6k MariaDB/MySQL : How to get version information
+29.5k Golang : Saving(serializing) and reading file with GOB
+20.9k PHP : Convert(cast) int to double/float
+29.9k Golang : How to get HTTP request header information?
+6.9k Fix sudo yum hang problem with no output or error messages
+39k Golang : How to iterate over a []string(array)
+34k Golang : Proper way to set function argument default value
+14.8k Golang : Find commonalities in two slices or arrays example
+12.7k Golang : Sort and reverse sort a slice of bytes
+5.8k Unix/Linux : How to test user agents blocked successfully ?