You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a map that maps a struct to another struct is defined, if the map keys are typed implicitely, and the package is imported by another package, godef throws an error
Steps to reproduce
(A github repo is linked below for the test)
Create a new directory, for example $GOPATH/src/test
Create a main.go file :
package main
import"fmt"import"test/someotherpackage"funcmain() {
fmt.Println(someotherpackage.Map)
}
Create another package, for example $GOPATH/src/test/someotherpackage
Category
Bug report
Environment and versions used
NB:
$GOPATH
and$GOROOT
are correctly setupIssue
When a map that maps a struct to another struct is defined, if the map keys are typed implicitely, and the package is imported by another package, godef throws an error
Steps to reproduce
(A github repo is linked below for the test)
$GOPATH/src/test
main.go
file :$GOPATH/src/test/someotherpackage
test.go
file :This produces the following stacktrace :
Stacktrace
Expected behaviour
It should find the declaration for
someotherpackage.Map
, as this is valid go syntax. The code compiles and runs fine !Reproducible demo
The test can be found here : https://github.com/Gandem/test-issue-godef
Cloning the repo in
$GOPATH/test
should work to reproduce the issue.Note :
godef -debug -f test.go Map
works fine when the command is run from$GOPATH/test/someotherpackage
The text was updated successfully, but these errors were encountered: