diff options
author | Robert Findley <rfindley@google.com> | 2022-07-11 16:55:34 -0400 |
---|---|---|
committer | Robert Findley <rfindley@google.com> | 2022-07-12 14:39:19 +0000 |
commit | a5adb0f2c2ab868ee0a7594bfd8432fc55545285 (patch) | |
tree | ac048653fc33f7c28b9df1bb2105dc924fe694c1 | |
parent | a79ee0f0f02a90ce00bfd721fae9d2d154cb7568 (diff) | |
download | golang-x-tools-a5adb0f2c2ab868ee0a7594bfd8432fc55545285.tar.gz |
internal/lsp/cache: use mod=readonly for process env funcs
CL 416874 changed the logic of populateProcessEnv and incorrectly
removed a write of ProcessEnv.ModFlag. We should explicitly set
-mod=readonly.
Change-Id: Ibacf3d4b4c0c978d65fde345741945d6136db159
Reviewed-on: https://go-review.googlesource.com/c/tools/+/416877
Reviewed-by: Alan Donovan <adonovan@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Robert Findley <rfindley@google.com>
-rw-r--r-- | internal/lsp/cache/imports.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/lsp/cache/imports.go b/internal/lsp/cache/imports.go index 7877c4f07..a08953db6 100644 --- a/internal/lsp/cache/imports.go +++ b/internal/lsp/cache/imports.go @@ -156,6 +156,7 @@ func (s *importsState) populateProcessEnv(ctx context.Context, snapshot *snapsho } pe.BuildFlags = inv.BuildFlags + pe.ModFlag = "readonly" // processEnv operations should not mutate the modfile pe.Env = map[string]string{} for _, kv := range inv.Env { split := strings.SplitN(kv, "=", 2) |