mirror of
https://github.com/golang/go
synced 2024-09-30 22:58:34 -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:
parent
c70d86f8b7
commit
2898d834dc
2
internal/lsp/cache/view.go
vendored
2
internal/lsp/cache/view.go
vendored
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user