Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 47958e6

Browse files
committed
Go.mod comments: trim newlines
These weren't previously reported as part of the comment text, but are as of the latest version of golang.org/x/tools
1 parent 380410e commit 47958e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

extractor/gomodextractor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func extractGoModComments(tw *trap.Writer, expr modfile.Expr, exprlbl trap.Label
168168
var first bool = true
169169
idx := 0
170170
for _, comment := range allComments {
171-
commentToken := strings.TrimSuffix(comment.Token, "\r")
171+
commentToken := strings.TrimSuffix(strings.TrimSuffix(comment.Token, "\n"), "\r")
172172
extractGoModComment(tw, comment, commentToken, grouplbl, idx)
173173
idx++
174174
commentEndCol := comment.Start.LineRune + (len(commentToken) - 1)

0 commit comments

Comments
 (0)