Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
psha- committed Oct 26, 2023
1 parent 3d857d6 commit 71d9da3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bind/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,12 @@ func (p *Package) getDoc(parent string, o types.Object) string {
}
// Check for typed consts
scopeName := p.pkg.Scope().Lookup(n)
constType := scopeName.Type()
constType := scopeName.Type().(*types.Named)
if constType == nil {
return ""
}
for _, t := range p.doc.Types {
if p.pkg.Path()+"."+t.Name == constType.String() {
if t.Name == constType.Obj().Name() {
for _, c := range t.Consts {
for _, cn := range c.Names {
if n == cn {
Expand Down

0 comments on commit 71d9da3

Please sign in to comment.