mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 16:24:40 +04:00
Merge pull request #3304 from AleksaC/go-toolchain
disable automatic toolchain switching for golang hooks
This commit is contained in:
commit
cb14bc2d9c
2 changed files with 71 additions and 0 deletions
|
|
@ -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'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue