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
+17.7k How to enable MariaDB/MySQL logs ?
+7.2k Golang : Use modern ciphers only in secure connection
+8.1k Golang : Variadic function arguments sanity check example
+14.5k Golang : Rename directory
+8.2k Golang : Find relative luminance or color brightness
+8.2k Golang : Metaprogramming example of wrapping a function
+7.4k Golang : Check to see if *File is a file or directory
+6.7k Golang : When to use make or new?
+5.4k Gogland : Datasource explorer
+30.9k Golang : Interpolating or substituting variables in string examples
+10.3k Golang : Embed secret text string into binary(executable) file
+62.7k Golang : Convert HTTP Response body to string