]> Cypherpunks repositories - gostls13.git/commit
cmd/go: error if -modfile used with 'go install pkg@version'
authorJay Conrod <jayconrod@google.com>
Tue, 29 Sep 2020 20:40:57 +0000 (16:40 -0400)
committerJay Conrod <jayconrod@google.com>
Wed, 30 Sep 2020 13:18:19 +0000 (13:18 +0000)
commit8b0d00b1645c47076f5b20dc692b2ca6d9bac19b
treee5ce0b5537c5db8e67608ac322a7a0e8b95bbd04
parent3caaaddffd605c0ec1787d68295b732fff73026b
cmd/go: error if -modfile used with 'go install pkg@version'

'go install pkg@version' runs without a main module or a module root
directory. The -modfile flag cannot be used to set the module root
directory or to substitute a different go.mod file.

This error won't be reported if -modfile is set in
GOFLAGS. Unsupported flags there are generally ignored.

For #40276

Change-Id: I0b39b1fa9184c15c6e863b647d43c328710920f4
Reviewed-on: https://go-review.googlesource.com/c/go/+/258297
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/go/internal/modload/init.go
src/cmd/go/testdata/script/mod_install_pkg_version.txt