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
+21.5k Golang : How to read float value from standard input ?
+36.4k Golang : Convert date or time stamp from string to time.Time type
+7.9k Golang : Ways to recover memory during run time.
+12.7k Golang : zlib compress file example
+6.7k Golang : When to use make or new?
+16.3k Golang :Trim white spaces from a string
+6.6k Golang : Warp text string by number of characters or runes example
+33.9k Golang : Call a function after some delay(time.Sleep and Tick)
+13.4k Golang : Read from buffered reader until specific number of bytes
+27.4k Golang : Convert CSV data to JSON format and save to file
+13.1k Golang : How to get a user home directory path?
+11.3k Golang : Byte format example