Skip to content

Commit 812f241

Browse files
committed
review
1 parent 134b776 commit 812f241

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pkg/goanalysis/pkgerrors/errors.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package pkgerrors
22

33
import (
4-
"cmp"
54
"errors"
65
"fmt"
76

@@ -28,7 +27,9 @@ func BuildIssuesFromIllTypedError(errs []error, lintCtx *linter.Context) ([]resu
2827
for _, err := range errs {
2928
var ill *IllTypedError
3029
if !errors.As(err, &ill) {
31-
other = cmp.Or(other, err)
30+
if other == nil {
31+
other = err
32+
}
3233
continue
3334
}
3435

pkg/result/processors/nolint.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package processors
22

33
import (
4-
"cmp"
54
"go/ast"
65
"go/parser"
76
"go/token"
@@ -286,7 +285,9 @@ func (e *rangeExpander) Visit(node ast.Node) ast.Visitor {
286285

287286
expandedRange := *foundRange
288287
// store the original unexpanded range for matching nolintlint issues
289-
expandedRange.originalRange = cmp.Or(expandedRange.originalRange, foundRange)
288+
if expandedRange.originalRange == nil {
289+
expandedRange.originalRange = foundRange
290+
}
290291
if expandedRange.To < nodeEndLine {
291292
expandedRange.To = nodeEndLine
292293
}

0 commit comments

Comments
 (0)