Proposal: Default env tag
mymmrac opened this issue · comments
Artem Yadelskyi commented
Hello, I propose to use filed name (to uppercase & to snake case) as default env tag if it's not specified
For example, this struct:
type A struct {
SomeText string
}
will be parsed the same as this:
type A struct {
SomeText string `env:"SOME_TEXT"`
}
New option can be introduced that will enable this functionality in order not to make braking change.
This will allow more convenient API for smaller application that do not critically depend on env names.
WDYT?
Carlos Alexandro Becker commented
interesting idea, will try to build a PoC
Carlos Alexandro Becker commented
see #253
Artem Yadelskyi commented
Yep, something like that will work perfectly
Carlos Alexandro Becker commented
merged