Jay Conrod c357b363cf cmd/go: add -modfile flag that sets go.mod file to read/write
This change adds the -modfile flag to module aware build commands and
to 'go mod' subcommands. -modfile may be set to a path to an alternate
go.mod file to be read and written. A real go.mod file must still
exist and is used to set the module root directory. However, it is not
opened.

When -modfile is set, the effective location of the go.sum file is
also changed to the -modfile with the ".mod" suffix trimmed (if
present) and ".sum" added.

Updates #34506

Change-Id: I2d1e044e18af55505a4f24bbff09b73bb9c908b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/202564
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-10-24 20:15:50 +00:00
..
2019-02-05 18:11:45 +00:00
2019-10-17 21:30:20 +00:00
2018-07-18 04:00:10 +00:00
2018-05-23 20:16:46 +00:00
2018-01-09 21:47:03 +00:00
2018-06-13 13:45:01 +00:00
2018-06-13 13:45:01 +00:00
2019-08-26 17:33:52 +00:00
2019-08-26 17:33:52 +00:00
2019-08-26 17:33:52 +00:00
2019-08-26 17:33:52 +00:00
2019-08-26 17:33:52 +00:00
2019-08-26 17:33:52 +00:00
2019-08-26 17:33:52 +00:00
2018-01-09 21:47:03 +00:00
2018-12-21 21:46:38 +00:00
2010-09-16 14:01:02 +10:00