@@ -25,21 +25,21 @@ const (
25
25
var _ Processor = (* SortResults )(nil )
26
26
27
27
type SortResults struct {
28
- cmps map [string ][] comparator
28
+ cmps map [string ]comparator
29
29
30
30
cfg * config.Output
31
31
}
32
32
33
33
func NewSortResults (cfg * config.Config ) * SortResults {
34
34
return & SortResults {
35
- cmps : map [string ][] comparator {
35
+ cmps : map [string ]comparator {
36
36
// For sorting we are comparing (in next order):
37
37
// file names, line numbers, position, and finally - giving up.
38
- orderNameFile : { byFileName (), byLine (), byColumn ()} ,
38
+ orderNameFile : byFileName (). AddNext ( byLine (). AddNext ( byColumn ())) ,
39
39
// For sorting we are comparing: linter name
40
- orderNameLinter : { byLinter ()} ,
40
+ orderNameLinter : byLinter (),
41
41
// For sorting we are comparing: severity
42
- orderNameSeverity : { bySeverity ()} ,
42
+ orderNameSeverity : bySeverity (),
43
43
},
44
44
cfg : & cfg .Output ,
45
45
}
@@ -58,7 +58,7 @@ func (sr SortResults) Process(issues []result.Issue) ([]result.Issue, error) {
58
58
var cmps []comparator
59
59
for _ , name := range sr .cfg .SortOrder {
60
60
if c , ok := sr .cmps [name ]; ok {
61
- cmps = append (cmps , c ... )
61
+ cmps = append (cmps , c )
62
62
} else {
63
63
return nil , fmt .Errorf ("unsupported sort-order name %q" , name )
64
64
}
0 commit comments