diff options
author | Michael Matloob <matloob@golang.org> | 2021-06-16 18:46:23 -0400 |
---|---|---|
committer | Michael Matloob <matloob@golang.org> | 2021-07-31 00:25:16 +0000 |
commit | 3799012990a324db968b8f377a5faf541cf20ac7 (patch) | |
tree | eb59eaeb694e34e604783b257dcaa98c8e35e1ae /src/cmd/go/internal/modload/init.go | |
parent | b3b53e1dad8681e3c21522513e4539813a5a3de7 (diff) | |
download | go-3799012990a324db968b8f377a5faf541cf20ac7.tar.gz go-3799012990a324db968b8f377a5faf541cf20ac7.zip |
[dev.cmdgo] cmd/go: add go mod editwork command
go mod editwork behaves similarly to go mod edit:
it has flags to change the go version, and add and remove
directory and replace directives.
For #45713
Change-Id: I1c795c122bfe461d6e87dd731692e0bf1bbe2bf7
Reviewed-on: https://go-review.googlesource.com/c/go/+/334938
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>
Diffstat (limited to 'src/cmd/go/internal/modload/init.go')
-rw-r--r-- | src/cmd/go/internal/modload/init.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index de8adbafc4..5dd946215b 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -249,6 +249,12 @@ func InitWorkfile() { } } +// WorkFilePath returns the path of the go.work file, or "" if not in +// workspace mode. WorkFilePath must be called after InitWorkfile. +func WorkFilePath() string { + return workFilePath +} + // Init determines whether module mode is enabled, locates the root of the // current module (if any), sets environment variables for Git subprocesses, and // configures the cfg, codehost, load, modfetch, and search packages for use |