Question: Using env vars without prefix
pantelis-karamolegkos opened this issue · 3 comments
pantelis-karamolegkos commented
Sorry in advance for opening a question as an issue, could not find a relevant community to direct this.
How can we use the env vars without prefix?
When I pass the empty string as prefix:
if err := conf.Parse(os.Args[1:], "", &cfg);
I get a leading underscore in the env vars generated
--web-service-port/$_SERVICE_PORT <int> (default: 98765)
This was previously defined in a cfg
struct as follows
Web struct {
ServicePort int `conf:"default:98765,env:SERVICE_PORT"`
}
ardan-bkennedy commented
I can make a code change to support this is an empty string is provided.
ardan-bkennedy commented
There is now version v1.4.0 that handles what you need.
pantelis-karamolegkos commented
💯 cool! Many thanks Bill.