Skip to content

Commit 2898d83

Browse files
committed
internal/lsp: fix tiny bug in getting files by basename
This change fixes gopls on Windows. Fixes golang/go#30967 Change-Id: Iba5eb6932a4acd6a574ad6970faf7c133ecb7d32 Reviewed-on: https://go-review.googlesource.com/c/tools/+/169703 Run-TryBot: Rebecca Stambler <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent c70d86f commit 2898d83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/lsp/cache/view.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (v *View) findFile(uri span.URI) *File {
234234
basename := basename(fname)
235235
if candidates := v.filesByBase[basename]; candidates != nil {
236236
pathStat, err := os.Stat(fname)
237-
if err == nil {
237+
if err != nil {
238238
return nil
239239
}
240240
for _, c := range candidates {

0 commit comments

Comments
 (0)