internal/lsp/source: remove the unused UpdateUserModFile invocation flag

Change-Id: I4325417e4d97d3ab82551c2fa0382aa3d962a781
Reviewed-on: https://go-review.googlesource.com/c/tools/+/382077
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Robert Findley 2022-01-31 15:47:29 -05:00
parent 727dfdb191
commit 4da8ceb6f1
2 changed files with 2 additions and 6 deletions

View File

@ -391,14 +391,13 @@ func (s *snapshot) goCommandInvocation(ctx context.Context, flags source.Invocat
} else {
inv.ModFlag = mutableModFlag
}
case source.UpdateUserModFile, source.WriteTemporaryModFile:
case source.WriteTemporaryModFile:
inv.ModFlag = mutableModFlag
}
}
wantTempMod := mode != source.UpdateUserModFile
needTempMod := mode == source.WriteTemporaryModFile
tempMod := wantTempMod && s.workspaceMode()&tempModfile != 0
tempMod := s.workspaceMode()&tempModfile != 0
if needTempMod && !tempMod {
return "", nil, cleanup, source.ErrTmpModfileUnsupported
}

View File

@ -201,9 +201,6 @@ const (
// Normal is appropriate for commands that might be run by a user and don't
// deliberately modify go.mod files, e.g. `go test`.
Normal InvocationFlags = iota
// UpdateUserModFile is for commands that intend to update the user's real
// go.mod file, e.g. `go mod tidy` in response to a user's request to tidy.
UpdateUserModFile
// WriteTemporaryModFile is for commands that need information from a
// modified version of the user's go.mod file, e.g. `go mod tidy` used to
// generate diagnostics.