-
-
Notifications
You must be signed in to change notification settings - Fork 931
disable automatic toolchain switching for golang hooks #3304
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,7 @@ def get_env_patch(venv: str, version: str) -> PatchesT: | |
|
|
||
| return ( | ||
| ('GOROOT', os.path.join(venv, '.go')), | ||
| ('GOTOOLCHAIN', 'local'), | ||
| ( | ||
| 'PATH', ( | ||
| os.path.join(venv, 'bin'), os.pathsep, | ||
|
|
@@ -145,6 +146,7 @@ def install_environment( | |
| env = no_git_env(dict(os.environ, GOPATH=gopath)) | ||
| env.pop('GOBIN', None) | ||
| if version != 'system': | ||
| env['GOTOOLCHAIN'] = 'local' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think (?) this should be part of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From what I can see I ran the test to make sure it works this way and it breaks when I move it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmmm I guess? but what about for hooks that just call - repo: local
hooks:
- id: gofmt
name: gofmt
language: golang
entry: gofmt -l -w
types: [go]
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I guess the variable should be set in both places then. |
||
| env['GOROOT'] = os.path.join(env_dir, '.go') | ||
| env['PATH'] = os.pathsep.join(( | ||
| os.path.join(env_dir, '.go', 'bin'), os.environ['PATH'], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this break with
language_version: system? this seems different than the install code belowThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the
language_versionissystemthe function is going to return before reaching that line, so it's consistent with the install code.