Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor gopls and cmd.Environ tweaks #840

Merged
merged 2 commits into from
Mar 8, 2024
Merged

minor gopls and cmd.Environ tweaks #840

merged 2 commits into from
Mar 8, 2024

Conversation

mvdan
Copy link
Member

@mvdan mvdan commented Mar 8, 2024

(see commit messages - please do not squash)

gopls correctly pointed out that the err==nil check was never met,
as err was assigned and we returned early when err!=nil.

This was an oversight when I wrote this; when Encode fails,
we shouldn't return, because we still want to close the file.
We don't defer because we want to check the error; explain that.
Added in Go 1.19, this keeps os/exec's default environment logic,
such as ensuring that $PWD is always set.
@mvdan mvdan requested review from lu4p and pagran March 8, 2024 11:24
@pagran pagran merged commit 20a9246 into burrowers:master Mar 8, 2024
5 checks passed
@mvdan mvdan deleted the tweaks branch March 30, 2024 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants