Command Line Argument Processing in Go: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= *Go Code Examples#Code_Examples =Overview= <font color=darkkhaki>Use the <code>flag</code> package: </font> <syntaxhighlight lang='go'> var port int flag.IntV...") |
|||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
*[[Go Code Examples#Code_Examples]] | *[[Go Code Examples#Code_Examples|Go Code Examples]] | ||
=Overview= | =Overview= | ||
Revision as of 22:53, 2 October 2023
Internal
Overview
Use the flag
package:
var port int
flag.IntVar(&port, "port", 8080, "Some documentation for the flag")
flag.Parse()