Golang flag.Int64() function example
package flag
Int64 defines an int64 flag with specified name(1st parameter), default value (2nd parameter), and usage(3rd parameter) string. The return value is the address of an int64 variable that stores the value of the flag.
Golang flag.Int64() function usage example
package main
import (
"flag"
"fmt"
)
func main() {
numberval := flag.Int64("number", 10800, "is an int64 value")
fmt.Println(flag.Lookup("number")) // print Flag struct
fmt.Println("number value : ", *numberval)
}
Output :
&{number is an int64 value 10800 10800}
number value : 10800
Reference :
Advertisement
Something interesting
Tutorials
+7.1k Javascript : How to get JSON data from another website with JQuery or Ajax ?
+6.9k Golang : How to setup a disk space used monitoring service with Telegram bot
+14.8k Golang : Find commonalities in two slices or arrays example
+9.9k Golang : Check if user agent is a robot or crawler example
+18.8k Golang : Delete duplicate items from a slice/array
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+12.4k Elastic Search : Return all records (higher than default 10)
+20.5k Golang : Pipe output from one os.Exec(shell command) to another command
+14.2k Golang : Convert IP version 6 address to integer or decimal number
+37.5k Golang : Converting a negative number to positive number
+24.6k Golang : How to print rune, unicode, utf-8 and non-ASCII CJK(Chinese/Japanese/Korean) characters?
+11.3k Golang : Fix fmt.Scanf() on Windows will scan input twice problem