You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a default strategy for filling in env variables values into struct definition is to overwrite them, it would be nice to specify it once when calling envconfig.Process.
The text was updated successfully, but these errors were encountered:
Hi @nieomylnieja - the entire point of this library over others is that it does not overwrite existing struct values unless explicitly given in the struct configuration. You might want to look at kelseyhightower/envconfig, which has the behavior you're looking for. Thanks!
hey @sethvargo :) Thanks for the reply! Unfortunately envconfig is no longer maintained, I used it over the years in many projects, but recently I wanted to move to another solution with active maintenance, go-envconfig looks really solid. I understand the default assumptions for this project are different then of kelsehigtowers', however since you've ended up including an option for the overwrite, wouldn't you consider exposing an API to change the defaults for some of the tag options? In general I'm not only talking about overwrite, but also delimiter or separator, having to place these options in tags for each field bloats the struct declaration and prevents the developer from enforcing these rules for the whole struct. I would be more than willing to contribute If you'd be open for such a feature :)
For now I ended up writing a simple version myself.
If a default strategy for filling in env variables values into struct definition is to overwrite them, it would be nice to specify it once when calling
envconfig.Process
.The text was updated successfully, but these errors were encountered: