Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How different it is from spf13/viper? #53

Closed
alok87 opened this issue Aug 10, 2020 · 2 comments
Closed

How different it is from spf13/viper? #53

alok87 opened this issue Aug 10, 2020 · 2 comments
Labels
discussion Running discussion question Further information is requested

Comments

@alok87
Copy link

alok87 commented Aug 10, 2020

I was going to use viper and then stumbled on this... Want to understand the differences to make a choice.

@ilyakaznacheev
Copy link
Owner

There is a huge difference in the ideas behind both.

Viper is a kinda Swiss knife for configuration - it handles a huge variety of use cases and it is massive, and many things are magically happening.

This library is about simplicity and explicitness, so there is no magic, maybe a bit more code and fewer features, but it keeps things simple: read config from file_1, then read from file_2, then read the rest from the environment (and each next read will override previous values with non-empty read values from current source).

Another feature that I proud the most of - is environment variable documentation, i.e. the library can prompt the list of all environment variables and their descriptions into help output. After my own production experience, having env. variables silently (without having a detailed description of them somewhere) is a real headache in long-running projects. So the library follows "documentation as a code" principle and allows you to just describe env. variable once (in structure tags) and then use in to read docs and to have an up-to-date description in help.

Hope this will help you to understand the difference and know when to use each library.

@ilyakaznacheev ilyakaznacheev added discussion Running discussion question Further information is requested labels Aug 14, 2020
@ilyakaznacheev ilyakaznacheev pinned this issue Aug 14, 2020
@alok87
Copy link
Author

alok87 commented Aug 14, 2020

Cool thank you, this answers it.

Great work making it.

@alok87 alok87 closed this as completed Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Running discussion question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants