gopls/internal/lsp/cache: assume Go 1.16+
Now that we no longer support Go versions prior to Go 1.16, clean up
some logic handling older Go versions.
Change-Id: I906b0f8e6abaa7d6a1b75321d48aad15f149e166
Reviewed-on: https://go-review.googlesource.com/c/tools/+/460916
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/gopls/internal/lsp/cache/snapshot.go b/gopls/internal/lsp/cache/snapshot.go
index b7bdadd..76350d5 100644
--- a/gopls/internal/lsp/cache/snapshot.go
+++ b/gopls/internal/lsp/cache/snapshot.go
@@ -328,8 +328,7 @@
}
mode |= moduleMode
options := s.view.Options()
- // The -modfile flag is available for Go versions >= 1.14.
- if options.TempModfile && s.view.workspaceInformation.goversion >= 14 {
+ if options.TempModfile {
mode |= tempModfile
}
return mode
@@ -539,13 +538,9 @@
return "", nil, cleanup, err
}
- mutableModFlag := ""
+ const mutableModFlag = "mod"
// If the mod flag isn't set, populate it based on the mode and workspace.
if inv.ModFlag == "" {
- if s.view.goversion >= 16 {
- mutableModFlag = "mod"
- }
-
switch mode {
case source.LoadWorkspace, source.Normal:
if vendorEnabled {