tigraine.at - Daniel Hoelbling-Inzko's Blog about programming and shiny things

Example domain paragraphs

Daniel Hoelbling-Inzko talks about programming

Usually when we start a new Go application the first stop is to install Viper and Cobra to handle all the commandline input/config flag needs we have.

But sometimes it's just a small program that should just do one thing and you forego all the ceremony and just use os.Args for parsing the commandline arguments. And next you think maybe a -debug flag for better logging would be nice, and you add vanilla flag.Parse() to it. All easy in Go, but one thing I wasn't aware of is that os.Args does contain all the flags so it becomes annoying to use flag and os.Args together.

Links to tigraine.at (2)