-
-
Notifications
You must be signed in to change notification settings - Fork 275
expand from default values #279
Copy link
Copy link
Closed
Labels
Description
Hi,
for example, if you have the following struct
type config struct {
Home string `env:"MY_HOME" envDefault:"/tmp"`
TempFolder string `env:"TEMP_FOLDER,expand" envDefault:"${MY_HOME}/temp"`
}
and there are no environment variables when you start the process. It would still be nice if you had an option to get Home: "/tmp" and TempFolder: "/tmp/temp", wouldn't it? I mean, we did specify what the defaults are :)
If expand shouldn't be used like that, maybe expandWithDefaults could be.
Cheers!
Reactions are currently unavailable