Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 379db4c

Browse files
committed
Use 'go install' instead of 'go get'
`go install` is the recommended way to install modules starting from go 1.16. In go 1.18 `go get` cannot be used anymore to install packages [1]. go 1.18 is not released yet. [1] https://tip.golang.org/doc/go1.18#go-command
1 parent 097f2c8 commit 379db4c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pre_commit/languages/golang.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ def install_environment(
7979
gopath = directory
8080
env = dict(os.environ, GOPATH=gopath)
8181
env.pop('GOBIN', None)
82-
cmd_output_b('go', 'get', './...', cwd=repo_src_dir, env=env)
82+
cmd_output_b('go', 'install', './...', cwd=repo_src_dir, env=env)
8383
for dependency in additional_dependencies:
84-
cmd_output_b('go', 'get', dependency, cwd=repo_src_dir, env=env)
84+
cmd_output_b(
85+
'go', 'install', dependency, cwd=repo_src_dir, env=env,
86+
)
8587
# Same some disk space, we don't need these after installation
8688
rmtree(prefix.path(directory, 'src'))
8789
pkgdir = prefix.path(directory, 'pkg')

0 commit comments

Comments
 (0)