Hacker News new | ask | show | jobs
by ainar-g 3620 days ago
I am a Go programmer and I've never seen anyone anywhere encouraging people to use anything over the flag package. How did you get such impression?
2 comments

Docker, for example, say "seriously just don't use it".

http://www.slideshare.net/jpetazzo/docker-and-go-why-did-we-...

Everybody I have ever seen do CLI applications in Go will recommend heavily against it.
The package you mentioned has about 200 imports. Compare that with the standard package. https://godoc.org/?q=Flag
If you want to write command line apps that conform to the GNU flags convention you can't use the "flag" library. I wrote my own simple getopt implementation (github.com/timtadh/getopt) years ago so I could just get some work done. It works fine and has no dependencies. I write a lot of complicated command line applications and having a small simple getopt implementation makes it a lot easier. Sometimes a higher level tool would be nice but I have never found one I actually like.
Why do minor variations in flag syntax matter so much you'd write your own? It seems easier to adjust to using the standard flag package.
The standard package cannot be changed.
By "adjust to" I meant living with the standard library's decisions without changing them. Compatibility with GNU syntax doesn't seem very important.