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
+7k Golang : Gargish-English language translator
+5.2k Responsive Google Adsense
+5.6k Javascript : How to refresh page with JQuery ?
+11.6k Swift : Convert (cast) Float to String
+6.6k Golang : Embedded or data bundling example
+7.1k Restart Apache or Nginx web server without password prompt
+24.5k Golang : Time slice or date sort and reverse sort example
+48.1k Golang : How to convert JSON string to map and slice
+16.6k Golang : Delete files by extension
+7.3k Golang : Calculate how many weeks left to go in a given year
+10.7k Golang : Underscore string example
+6.8k Get Facebook friends working in same company