Skip to content

set "app_root" from environment variables #23

Description

@BastiPaeltz

Hey,

I think it would be nice to be able to set the app_root from environment variables like this:

app_root: "$GOPATH/src/$APP_PATH"

It should be pretty easy to implement this, there just would need to be a call to os.ExpandEnv(c.AppRoot) at the end of the Load function. E.g.:

func (c *Configuration) Load(path string) error {
	data, err := ioutil.ReadFile(path)
	if err != nil {
		return err
	}
	err = yaml.Unmarshal(data, c)
	if err != nil {
		return err
	}

	c.AppRoot = os.ExpandEnv(c.AppRoot)

	return err
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions