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
+10.3k Golang : Wait and sync.WaitGroup example
+7.9k Golang Hello World Example
+16.9k Golang : How to generate QR codes?
+8.3k Golang : Emulate NumPy way of creating matrix example
+6.1k Golang : Scan forex opportunities by Bollinger bands
+62.7k Golang : Convert HTTP Response body to string
+8.4k Golang : Ackermann function example
+30.8k Golang : Download file example
+7k Golang : Levenshtein distance example
+6.3k Golang : Test input string for unicode example
+6.7k Golang : Derive cryptographic key from passwords with Argon2
+9.9k Golang : Check if user agent is a robot or crawler example