Merge pull request #3304 from AleksaC/go-toolchain

disable automatic toolchain switching for golang hooks
This commit is contained in:
Anthony Sottile 2024-11-25 18:54:37 -05:00 committed by GitHub
commit cb14bc2d9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 71 additions and 0 deletions

View file

@ -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'
env['GOROOT'] = os.path.join(env_dir, '.go')
env['PATH'] = os.pathsep.join((
os.path.join(env_dir, '.go', 'bin'), os.environ['PATH'],