-
-
Notifications
You must be signed in to change notification settings - Fork 401
Open
Labels
Description
os/exec.Command returns a Cmd with only Path and Args filled out.
That means that doing
cmd := exec.Command("foo")
cmd.Env = append(cmd.Env, "FOO=bar")
is always equivalent to
cmd := exec.Command("foo")
cmd.Env = []string{"FOO=bar"}
but almost certainly intended to be
cmd := exec.Command("foo")
cmd.Env = append(cmd.Environ(), "FOO=bar")
instead.
I introduced this bug at least a couple times in the standard library tests.
mvdan