Skip to content

Commit

Permalink
do not generate a new string
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed May 3, 2021
1 parent 2ae0848 commit b884ee1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modfile/rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,8 @@ func setIndirect(line *Line, indirect bool) {
}

// Removing comment.
f := strings.TrimSpace(strings.ReplaceAll(line.Suffix[0].Token, " ", ""))
if f == "//indirect" {
f := strings.TrimSpace(strings.TrimPrefix(line.Suffix[0].Token, string(slashSlash)))
if f == "indirect" {
// Remove whole comment.
line.Suffix = nil
return
Expand Down

0 comments on commit b884ee1

Please sign in to comment.