Skip to content

Commit 723b3d7

Browse files
committed
fixes comment
1 parent 584da5e commit 723b3d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types_comment_locator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func commentLocator(pos, end token.Pos, comments []*ast.CommentGroup) *ast.Comme
3434
i := sort.Search(len(comments), func(i int) bool {
3535
return pos < comments[i].Pos()
3636
})
37-
if i == -1 {
37+
if i == -1 || i >= len(comments) {
3838
return nil
3939
}
4040
if comments[i].End() < end {

0 commit comments

Comments
 (0)