Skip to content

Commit

Permalink
Fix versionned packages
Browse files Browse the repository at this point in the history
  • Loading branch information
juliens committed Aug 23, 2023
1 parent b33deb5 commit 79b586b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions syrup.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,20 +610,20 @@ func (s Syrup) getTupleTypes(t *types.Tuple) []string {
}

func (s Syrup) getNamedTypeName(t *types.Named) string {
if t.Obj() != nil && t.Obj().Pkg() != nil {
if t.Obj().Pkg().Path() == s.PkgPath {
return t.Obj().Name()
} else {

Check failure on line 616 in syrup.go

View workflow job for this annotation

GitHub Actions / Main Process

indent-error-flow: if block ends with a return statement, so drop this else and outdent its block (revive)
return t.Obj().Pkg().Name() + "." + t.Obj().Name()
}
}

name := t.String()

i := strings.LastIndex(t.String(), "/")
if i > -1 {
name = name[i+1:]
}

if t.Obj() != nil && t.Obj().Pkg() != nil {
if t.Obj().Pkg().Path() == s.PkgPath {
i := strings.Index(name, ".")
return name[i+1:]
}
}

return name
}

Expand Down

0 comments on commit 79b586b

Please sign in to comment.