Skip to content

expand from default values #279

@kriptor

Description

@kriptor

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!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions