fix(session): use fmt.Fprintf with nolint to satisfy both staticcheck and errcheck
This commit is contained in:
@@ -23,14 +23,14 @@ func FormatHistory(entries []Entry, excludePhase string) string {
|
||||
var b strings.Builder
|
||||
b.WriteString("## Session history\n\n")
|
||||
for _, e := range filtered {
|
||||
b.WriteString(fmt.Sprintf("### Phase: %s\n", e.Phase))
|
||||
b.WriteString(fmt.Sprintf("- Skill: %s\n", e.Skill))
|
||||
b.WriteString(fmt.Sprintf("- Status: %s\n", e.FinalStatus))
|
||||
fmt.Fprintf(&b, "### Phase: %s\n", e.Phase) //nolint:errcheck // strings.Builder never errors
|
||||
fmt.Fprintf(&b, "- Skill: %s\n", e.Skill) //nolint:errcheck
|
||||
fmt.Fprintf(&b, "- Status: %s\n", e.FinalStatus) //nolint:errcheck
|
||||
if e.FilePath != "" {
|
||||
b.WriteString(fmt.Sprintf("- File: %s\n", e.FilePath))
|
||||
fmt.Fprintf(&b, "- File: %s\n", e.FilePath) //nolint:errcheck
|
||||
}
|
||||
if e.Message != "" {
|
||||
b.WriteString(fmt.Sprintf("- Summary: %s\n", e.Message))
|
||||
fmt.Fprintf(&b, "- Summary: %s\n", e.Message) //nolint:errcheck
|
||||
}
|
||||
b.WriteString("\n")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user