Skip to content

Commit 43bd2f5

Browse files
committed
fix class comment not displaying if not methods
1 parent 9210785 commit 43bd2f5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

parser/parser.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,14 @@ func classFromFile(filepath string) Class {
7474
if class.Line == 0 {
7575
return class
7676
}
77+
// Retrieve class comments
78+
class.Comment = allComments.findCommentFor(class.Line)
7779

7880
// Return class if there is not built-in methods
7981
if methods == nil {
8082
return class
8183
}
8284

83-
// Retrieve class comments
84-
class.Comment = allComments.findCommentFor(class.Line)
85-
8685
// Loop through methods to find each method
8786
allExpr := methods.Values[0].(*ast.CompositeLit).Elts
8887
var attrs []ast.Expr

0 commit comments

Comments
 (0)