From 6d19fbfa2b3abe573f93461832e41012c648980e Mon Sep 17 00:00:00 2001 From: Heschi Kreinick Date: Thu, 4 Feb 2021 11:20:48 -0500 Subject: [PATCH] internal/lsp/cache: fix AllowModfileModifications on 1.16 We still need to pass -mod=mod when AllowModfileModifications is enabled on 1.16. Change-Id: I9cecd30914eb52c9faa877cece25d5722b36df79 Reviewed-on: https://go-review.googlesource.com/c/tools/+/289695 Trust: Heschi Kreinick Run-TryBot: Heschi Kreinick Reviewed-by: Rebecca Stambler gopls-CI: kokoro TryBot-Result: Go Bot --- internal/lsp/cache/snapshot.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/lsp/cache/snapshot.go b/internal/lsp/cache/snapshot.go index d8b2462950..019a7e63b0 100644 --- a/internal/lsp/cache/snapshot.go +++ b/internal/lsp/cache/snapshot.go @@ -326,6 +326,8 @@ func (s *snapshot) goCommandInvocation(ctx context.Context, flags source.Invocat inv.ModFlag = "vendor" } else if !allowModfileModificationOption { inv.ModFlag = "readonly" + } else { + inv.ModFlag = mutableModFlag } case source.UpdateUserModFile, source.WriteTemporaryModFile: inv.ModFlag = mutableModFlag