2 ms·
I just ran into this for the first time in many years of Go usage. I wrote a command line utility for some code gen. If a flag was left off, I needed to prompt
by sethammons 9y ago
I just ran into this for the first time in many years of Go usage. I wrote a command line utility for some code gen. If a flag was left off, I needed to prompt the user for an explicit value. For Boolean flags, this was not doable. I had to create a type that matched the flagset interface and use flag.Var for parsing it.