go version)?go 1.9.2
go env)?windows 7 amd64
I tried to find all the references of a go function from entire GOPATH.
In linux it works as expected.But in windows it shows only the references from the same package.
command:-
guru -json referrers src\samplepac\sample.go:#3242,#3249
This line appears to be the culprit:
https://github.com/golang/tools/blob/a5b4c53f6e8bdcafa95a94671bf2d1203365858b/cmd/guru/what.go#L205
The slashes of the import path are not normalized, which causes comparisons fail later on (here, specifically). Using filepath.ToSlash on importPath appears to fix the problem. For example,
importPath = filepath.ToSlash(importPath)
Change https://golang.org/cl/151057 mentions this issue: cmd/guru: fix guessImportPath for Windows
I'm affected too. I confirm the change at https://golang.org/cl/151057 fixes the problem.
I think this is a dupe of #23318.