Skip to content

Commit

Permalink
Merge pull request #300 from testwill/replace-loop
Browse files Browse the repository at this point in the history
chore: slice replace loop
  • Loading branch information
ks-ci-bot authored Sep 20, 2023
2 parents 5985af2 + 5157b4e commit 3256882
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions controllers/kubeeye/clusterinsight_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ func formatResults(receiver <-chan []kubeeyev1alpha1.AuditResults) (formattedRes

for results := range receiver {
for _, result := range results {
for _, resultInfo := range result.ResultInfos {
fmAuditResults[result.NameSpace] = append(fmAuditResults[result.NameSpace], resultInfo)
}
fmAuditResults[result.NameSpace] = append(fmAuditResults[result.NameSpace], result.ResultInfos...)
}
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/audit/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ func defaultOutput(receiver <-chan []v1alpha1.AuditResults) error {
func JSONOutput(receiver <-chan []v1alpha1.AuditResults) error {
var output []v1alpha1.AuditResults
for r := range receiver {
for _, results := range r {
output = append(output, results)
}
output = append(output, r...)
}

// output json
Expand Down

0 comments on commit 3256882

Please sign in to comment.