aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/internal/base/flag.go
AgeCommit message (Collapse)Author
2021-07-30[dev.cmdgo] cmd/internal/str: move package from cmd/go/internal/strJay Conrod
This will let cmd/cgo and cmd/link use this package for argument parsing. For golang/go#41400 Change-Id: I12ee21151bf3f00f3e8d427faaaab2453c823117 Reviewed-on: https://go-review.googlesource.com/c/go/+/334730 Trust: Jay Conrod <jayconrod@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
2021-07-26[dev.cmdgo] cmd/go: add the workspace modeMichael Matloob
This change adds the outline of the implementation of the workspace mode. The go command will now locate go.work files, and read them to determine which modules are in the workspace. It will then put those modules in the root of the workspace when building the build list. It supports building, running, testing, and listing in workspaces. There are still many TODOs for undone work and other changes to fix certain cases. Some of these undone parts include: replaces and go.work.sum files, as well as go mod {test,why,verify}, excludes in workspaces, updating work files to include module names in comments and setting the GOWORK variable. For #45713 Change-Id: I72716af7a300a2896087fc8a79c04e951d248278 Reviewed-on: https://go-review.googlesource.com/c/go/+/334934 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-11-20cmd/go: support the -overlay flag for go mod commandsMichael Matloob
Move the declaration of the -overlay flag to base.AddModCommonFlags, where other flags that are needed for go mod commands and for builds are declared. The flag's already initialized in modload.Init so there's no additional work needed to be done to support it in the go mod commands. For #39958 Change-Id: I70725d620cc69cb820f6ed923d626f4fe041b1c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/272126 Trust: Michael Matloob <matloob@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-09-11cmd/go: refactor -mod flag parsingJay Conrod
Keep track of whether the -mod flag was set explicitly. When -mod=readonly is the default, we'll want to adjust our error messages if it's set explicitly. Also, register the -mod, -modcacherw, and -modfile flags in functions in internal/base instead of internal/work. 'go mod' commands that don't load packages shouldn't depend on internal/work. For #40728 Change-Id: I272aea9e19908ba37e151baac4ea8630e90f241f Reviewed-on: https://go-review.googlesource.com/c/go/+/253744 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-10-08cmd/go: respect -mod flag in fmtDan Peterson
Fixes #27841 Change-Id: Ifcfd938aff8680cf7b44dfc09fde01d6105345a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/198257 Run-TryBot: Dan Peterson <dpiddy@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
2017-02-03cmd/go: address review commentsRuss Cox
Address review comments from earlier CLs. These are changes I was too scared to try to push down into the original CLs (thanks, Git). Change-Id: I0e428fad73d71bd2a7d08178cf2e856de3cef19f Reviewed-on: https://go-review.googlesource.com/36257 Reviewed-by: David Crawshaw <crawshaw@golang.org>
2017-02-03cmd/go: split out cmd/go/internal/workRuss Cox
This is one CL in a long sequence of changes to break up the go command from one package into a plausible group of packages. This sequence is concerned only with moving code, not changing or cleaning up code. There will still be more cleanup after this sequence. The entire sequence will be submitted together: it is not a goal for the tree to build at every step. For #18653. Change-Id: Icdd181098f9f0e81f68bf201e6867cdd8f820300 Reviewed-on: https://go-review.googlesource.com/36197 Reviewed-by: David Crawshaw <crawshaw@golang.org>