Skip to content

Commit ca866ea

Browse files
committed
Remove unused function and type to fix golangci-lint errors
1 parent 3ee6abd commit ca866ea

2 files changed

Lines changed: 0 additions & 45 deletions

File tree

pkg/reports/narrative/builder.go

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package narrative
22

33
import (
4-
"fmt"
5-
64
"github.com/varax/operator/pkg/evidence"
75
"github.com/varax/operator/pkg/models"
86
)
@@ -71,45 +69,6 @@ func buildForControl(cr models.ControlResult, items []evidence.EvidenceItem) Con
7169
}
7270
}
7371

74-
// buildMinimal creates a simple narrative for controls with thin scan coverage.
75-
func buildMinimal(cr models.ControlResult, focus string) ControlNarrative {
76-
passCount, failCount := countCheckStatus(cr)
77-
status := statusLabel(passCount, failCount)
78-
79-
summary := fmt.Sprintf(
80-
"This cluster was assessed for %s. %s %s mapped to this control, with %s.",
81-
focus,
82-
pluralize(len(cr.CheckResults), "check", "checks"),
83-
verbAgreement(len(cr.CheckResults)),
84-
countByStatus(passCount, failCount),
85-
)
86-
87-
var findingsText string
88-
if failCount > 0 {
89-
findings := extractFindings(cr)
90-
if len(findings) > 0 {
91-
lines := make([]string, len(findings))
92-
for i, f := range findings {
93-
lines[i] = fmt.Sprintf("%s: %s", f.CheckID, f.Message)
94-
}
95-
findingsText = "Findings requiring attention: " + joinList(lines) + "."
96-
}
97-
}
98-
99-
assessment := fmt.Sprintf("Assessment: %s — %s.", status, countByStatus(passCount, failCount))
100-
101-
if findingsText != "" {
102-
return MinimalNarrative{
103-
Summary: summary + " " + findingsText,
104-
Assessment: assessment,
105-
}
106-
}
107-
return MinimalNarrative{
108-
Summary: summary,
109-
Assessment: assessment,
110-
}
111-
}
112-
11372
// countCheckStatus counts passing and failing checks in a control result.
11473
func countCheckStatus(cr models.ControlResult) (pass, fail int) {
11574
for _, c := range cr.CheckResults {

pkg/reports/narrative/types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ func findingsSection(findings []Finding) NarrativeSection {
4141
}
4242

4343
// Detect corroborating findings: group by normalized message content
44-
type group struct {
45-
checkIDs []string
46-
message string
47-
}
4844
groups := groupCorroboratingFindings(findings)
4945

5046
var items []string

0 commit comments

Comments
 (0)