Golang flag.Uint64() function example
package flag
Uint64 defines a uint64 flag with specified name(1st parameter), default value(2nd parameter), and usage string(3rd parameter). The return value is the address of a uint64 variable that stores the value of the flag.
Golang flag.Uint64() function usage example
package main
import (
"flag"
"fmt"
"strconv"
)
func main() {
hotDataSize := flag.Uint64("hotDataSize", 0, "Hot data size in bytes. 0 disables hot data optimization")
flag.Parse()
fmt.Println(flag.Lookup("hotDataSize")) // print the Flag struct
fmt.Printf("Hot Data Size is %s\n ", strconv.FormatUint(uint64(*hotDataSize), 3))
}
Output :
&{hotDataSize Hot data size in bytes. 0 disables hot data optimization 0 0}
Hot Data Size is 0
Reference :
Advertisement
Something interesting
Tutorials
+8.4k Golang : Ackermann function example
+11.5k Golang : Generate DSA private, public key and PEM files example
+22.4k Golang : How to read JPG(JPEG), GIF and PNG files ?
+7.7k Gogland : Where to put source code files in package directory for rookie
+6.9k Golang : Pat multiplexer routing example
+9.6k Golang : How to generate Code 39 barcode?
+11.4k Golang : Concatenate (combine) buffer data example
+27.2k Golang : Find files by name - cross platform example
+7.1k Golang : Squaring elements in array
+7.9k Swift : Convert (cast) String to Float
+9.3k Golang : How to get garbage collection data?
+7.4k Golang : Word limiter example