You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-08-08 04:42:07 +03:00
Update vendored tools/.
This commit is contained in:
13
tools/vendor/github.com/alecthomas/gometalinter/aggregate.go
generated
vendored
13
tools/vendor/github.com/alecthomas/gometalinter/aggregate.go
generated
vendored
@@ -18,6 +18,13 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
func maybeAggregateIssues(issues chan *Issue) chan *Issue {
|
||||
if !config.Aggregate {
|
||||
return issues
|
||||
}
|
||||
return aggregateIssues(issues)
|
||||
}
|
||||
|
||||
func aggregateIssues(issues chan *Issue) chan *Issue {
|
||||
out := make(chan *Issue, 1000000)
|
||||
issueMap := make(map[issueKey]*multiIssue)
|
||||
@@ -30,18 +37,18 @@ func aggregateIssues(issues chan *Issue) chan *Issue {
|
||||
message: issue.Message,
|
||||
}
|
||||
if existing, ok := issueMap[key]; ok {
|
||||
existing.linterNames = append(existing.linterNames, issue.Linter.Name)
|
||||
existing.linterNames = append(existing.linterNames, issue.Linter)
|
||||
} else {
|
||||
issueMap[key] = &multiIssue{
|
||||
Issue: issue,
|
||||
linterNames: []string{issue.Linter.Name},
|
||||
linterNames: []string{issue.Linter},
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, multi := range issueMap {
|
||||
issue := multi.Issue
|
||||
sort.Strings(multi.linterNames)
|
||||
issue.Linter.Name = strings.Join(multi.linterNames, ", ")
|
||||
issue.Linter = strings.Join(multi.linterNames, ", ")
|
||||
out <- issue
|
||||
}
|
||||
close(out)
|
||||
|
Reference in New Issue
Block a user