30 ms·
https://github.com/spf13/viper/blob/master/go.mod https://github.com/spf13/viper/blob/master/go.mod 16 direct dependencies, 39 transitive dependencies, and nea
by nemo1618 4y ago
https://github.com/spf13/viper/blob/master/go.mod https://github.com/spf13/viper/blob/master/go.mod
16 direct dependencies, 39 transitive dependencies, and nearly 7000 lines of code -- for a package that handles flags and config files. I can't help feeling that frameworks like this are a little overwrought. It's the sort of project that succeeds because thousands of people just need something that works, right away, so they search for "golang config" and click the top result. Whereas if you can afford to slow down a little, you might find that the stdlib (with a bit of glue) is a perfectly serviceable option for the majority of apps.
- rgoulter 4y agoI think any single feature isn't too difficult to replace with go's stdlib stuff. e.g. to read a flag, or read in a config file. Viper has sophisticated functionality such that it might read a config file from one of several paths; the properties of which can be overridden with environment variables or command line flags. With an emphasis on productivity, I think those mechanisms are useful, and probably not worth spending time to NIH from stdlib.