1
0
mirror of https://github.com/golang/go synced 2024-10-01 01:38:33 -06:00

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 <rstambler@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Rebecca Stambler 2019-03-27 22:12:54 -04:00
parent c70d86f8b7
commit 2898d834dc

View File

@ -234,7 +234,7 @@ func (v *View) findFile(uri span.URI) *File {
basename := basename(fname)
if candidates := v.filesByBase[basename]; candidates != nil {
pathStat, err := os.Stat(fname)
if err == nil {
if err != nil {
return nil
}
for _, c := range candidates {