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 <heschi@google.com>
Run-TryBot: Heschi Kreinick <heschi@google.com>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
Heschi Kreinick 2021-02-04 11:20:48 -05:00
parent 6baea3f8f3
commit 6d19fbfa2b
1 changed files with 2 additions and 0 deletions

View File

@ -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