It may be helpful if envconfig can provide list of env variables for config struct. It can be just []string with list of vars or even more smarty, []EnvVar, like:
type EnvVar struct {
Name string
Required bool
Ignored bool
SplitWords bool
Default string
etc...
}
so user can do whatever he needs with this list
Motivation
When new developer started to work with project or DevOps team wants to get list of configurable ENV or we just wanted to have actual documentation about ENV configurable variables.
Example
Something like
type Specification struct {
ManualOverride1 string `envconfig:"manual_override_1"`
DefaultVar string `default:"foobar"`
RequiredVar string `required:"true"`
IgnoredVar string `ignored:"true"`
AutoSplitVar string `split_words:"true"`
RequiredAndAutoSplitVar string `required:"true" split_words:"true"`
}
var s Specification
list := envconfig.ExtractList("myapp", &s)
So the list will have full list of ENV vars that can configure our App
What do you think? If it's useful I can make PR for this feature
Feature Request
It may be helpful if envconfig can provide list of env variables for config struct. It can be just []string with list of vars or even more smarty, []EnvVar, like:
so user can do whatever he needs with this list
Motivation
When new developer started to work with project or DevOps team wants to get list of configurable ENV or we just wanted to have actual documentation about ENV configurable variables.
Example
Something like
So the list will have full list of ENV vars that can configure our App
What do you think? If it's useful I can make PR for this feature