Golang flag.FlagSet.SetOutput() function example
package flag
SetOutput sets the destination for usage and error messages. If output is nil, os.Stderr is used.
Golang flag.FlagSet.SetOutput() function usage example
f := flag.NewFlagSet("", flag.ContinueOnError)
f.SetOutput(ioutil.Discard) // send all usage and error messages to blackhole
Reference :
Advertisement
Something interesting
Tutorials
+17.1k Golang : Capture stdout of a child process and act according to the result
+6.5k Golang : Map within a map example
+6k Linux/MacOSX : Search for files by filename and extension with find command
+21.9k Golang : Use TLS version 1.2 and enforce server security configuration over client
+9.3k Golang : How to get username from email address
+12.6k Golang : flag provided but not defined error
+31.7k Golang : How to convert(cast) string to IP address?
+11.3k Golang : Byte format example
+10k Golang : Read file and convert content to string
+8.8k Golang : Heap sort example
+18.3k Golang : Get path name to current directory or folder