8000 gocommand: honor clean environment with no variables by dajiaohuang · Pull Request #1828 · dominikh/go-tools · GitHub
[go: up one dir, main page]

Skip to content

gocommand: honor clean environment with no variables - #1828

Closed
dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/gocommand-clean-env
Closed

dajiaohuang wants to merge 1 commit into
dominikh:masterfrom
dajiaohuang:fix/gocommand-clean-env

Conversation

@dajiaohuang
@dajiaohuang dajiaohuang commented Oct 2, 2026 •
Copy link
Copy Markdown

Invocation.CleanEnv documents that a command runs only with Invocation.Env, but a clean invocation with an empty Env left exec.Cmd.Env nil. os/exec interprets nil as inheriting the parent process environment, so the clean-environment option was ineffective in this valid case. Initialize a non-nil empty environment before appending Invocation.Env.

Static review against os/exec documentation and git diff --check only; no tests added or run per coordinator direction.

@dajiaohuang dajiaohuang closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0