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

Make goenv parsing robust across go versions and OSes #455

Merged
merged 1 commit into from
Aug 9, 2023

Conversation

liggitt
Copy link
Contributor

@liggitt liggitt commented Aug 9, 2023

Fixes #449

@quasilyte quasilyte merged commit 902760a into quasilyte:master Aug 9, 2023
1 check failed
@quasilyte
Copy link
Owner

Thank you for the investigation and this fix!

@liggitt
Copy link
Contributor Author

liggitt commented Aug 9, 2023

the lint check failed because it thinks this can inject args into the process invocation:

Error: internal/goenv/goenv.go:10:14: G204: Subprocess launched with a potential tainted input or cmd arguments (gosec)
	out, err := exec.Command("go", append([]string{"env"}, varNames...)...).CombinedOutput()

we could hard-code the envs we look up instead of passing them in, but that would make unit testing harder

@liggitt
Copy link
Contributor Author

liggitt commented Aug 9, 2023

opened follow-up in #456 to see if that makes the linter happier

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.

go1.21: load rules: parse rules file: typechecker error: ...: could not import
2 participants