Closed blacknbunny closed 6 years ago
Ah that mistake is intended. Also there's no need to get a string flag and parse it to bool. Go supports setting bool flags like this -log=true or -log=false. The existence of the -log will also count as true.
-log=true
-log=false
-log
true
but with this parse you can use "log" param without =
Yes but for a bool flag you just include it. No need to mention it's true or not. Similar to the -v switch in many other tools.
-v
Ah that mistake is intended. Also there's no need to get a string flag and parse it to bool. Go supports setting bool flags like this
-log=true
or-log=false
. The existence of the-log
will also count astrue
.