Skip to content

os.ExpandEnv doesn't recursively fetch environment variables #16785

Closed
@jnmoal

Description

@jnmoal

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go version go1.7 linux/amd64

  1. What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"

  1. What did you do?
    https://play.golang.org/p/-chU68uIbC
  2. What did you expect to see?
    /first/value:/second/value
  3. What did you see instead?
    $ENV1:$ENV2

I'm working on an example for the "os" package to help a little on the issue 16360.

According to how os.Expand is implemented this is not a bug, but I was expecting that this function would recursively fetch the environment variables in order to expand it.

Is this a wanted behavior?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions