godef icon indicating copy to clipboard operation
godef copied to clipboard

fix crash when find the map's element which its defination in other f…

Open tw4452852 opened this issue 10 years ago • 3 comments

when we find a map's element which its defination is located in another file, it will crash.

Signed-off-by: Tw [email protected]

tw4452852 avatar May 30 '15 08:05 tw4452852

Assume there are two files:

// 1.go
type A struct{}
// 2.go
m := make(map[string]A)
if elm, ok := m["test"]; ok {
     // do something
}

if we find elm definition, godef will crash.

tw4452852 avatar May 30 '15 08:05 tw4452852

LGTM, thanks! Please fix conflicts and I will merge.

rogpeppe avatar May 27 '16 11:05 rogpeppe

Done.

tw4452852 avatar May 30 '16 10:05 tw4452852