mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
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
This commit is contained in:
@@ -168,7 +168,7 @@ func extractGoModComments(tw *trap.Writer, expr modfile.Expr, exprlbl trap.Label
|
||||
var first bool = true
|
||||
idx := 0
|
||||
for _, comment := range allComments {
|
||||
commentToken := strings.TrimSuffix(comment.Token, "\r")
|
||||
commentToken := strings.TrimSuffix(strings.TrimSuffix(comment.Token, "\n"), "\r")
|
||||
extractGoModComment(tw, comment, commentToken, grouplbl, idx)
|
||||
idx++
|
||||
commentEndCol := comment.Start.LineRune + (len(commentToken) - 1)
|
||||
|
||||
Reference in New Issue
Block a user