Skip to content

Commit 71d9da3

Browse files
committed
Simplify
1 parent 3d857d6 commit 71d9da3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bind/package.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ func (p *Package) getDoc(parent string, o types.Object) string {
122122
}
123123
// Check for typed consts
124124
scopeName := p.pkg.Scope().Lookup(n)
125-
constType := scopeName.Type()
125+
constType := scopeName.Type().(*types.Named)
126+
if constType == nil {
127+
return ""
128+
}
126129
for _, t := range p.doc.Types {
127-
if p.pkg.Path()+"."+t.Name == constType.String() {
130+
if t.Name == constType.Obj().Name() {
128131
for _, c := range t.Consts {
129132
for _, cn := range c.Names {
130133
if n == cn {

0 commit comments

Comments
 (0)