summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-02-18 12:43:59 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-02-18 15:06:58 +0100
commita87be597af21b8f7000706b3ed4201022a9b7a8f (patch)
treea15a5363dddefe56ad7251ddb7c8eefd559446f2 /modules
parentb0eea007560a04e10d6e9f8bf6fee8b39e1deb34 (diff)
modules: Add modules.Workspace config for Go 1.18
Sets `GOWORK` env var for Go 1.18. Fixes #9525
Diffstat (limited to 'modules')
-rw-r--r--modules/client.go1
-rw-r--r--modules/config.go6
2 files changed, 7 insertions, 0 deletions
diff --git a/modules/client.go b/modules/client.go
index 17e149ecf..fe0abc462 100644
--- a/modules/client.go
+++ b/modules/client.go
@@ -90,6 +90,7 @@ func NewClient(cfg ClientConfig) *Client {
"GOPRIVATE", mcfg.Private,
"GONOPROXY", mcfg.NoProxy,
"GOPATH", cfg.CacheDir,
+ "GOWORK", mcfg.Workspace, // Requires Go 1.18, see https://tip.golang.org/doc/go1.18
// GOCACHE was introduced in Go 1.15. This matches the location derived from GOPATH above.
"GOCACHE", filepath.Join(cfg.CacheDir, "pkg", "mod"),
)
diff --git a/modules/config.go b/modules/config.go
index ac9eadd37..4b39636cd 100644
--- a/modules/config.go
+++ b/modules/config.go
@@ -295,6 +295,12 @@ type Config struct {
NoProxy string
// Configures GOPRIVATE.
Private string
+
+ // Set the workspace file to use, e.g. hugo.work.
+ // Enables Go "Workspace" mode.
+ // Requires Go 1.18+
+ // See https://tip.golang.org/doc/go1.18
+ Workspace string
}
// hasModuleImport reports whether the project config have one or more