Advanced flag parsing in standard Go
Over time, a plethora of libraries were developed to build complex CLI applications; spf13/cobra and urfave/cli being probably the most used ones (both have tens of thousands stars on GitHub). While they offer lots of features out of the box, I often found them complex and overkill for my needs. In this post, we will have an overview of how Go’s flag works and see some advanced uses of it. We will then try to implement parsing of complex values such as comma-separated arguments or slices.