Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

chore: Add line returns to clog output #414

Merged
merged 2 commits into from
Aug 12, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use Fprintf
  • Loading branch information
kylecarbs committed Aug 12, 2021
commit c9ba330ef5876724c3f1f331ad7e124d806eaa83
7 changes: 3 additions & 4 deletions pkg/clog/clog.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ type CLIError struct {
// String formats the CLI message for consumption by a human.
func (m CLIMessage) String() string {
var str strings.Builder
str.WriteString(fmt.Sprintf("%s: %s\r\n",
fmt.Fprintf(&str, "%s: %s\r\n",
color.New(m.Color).Sprint(m.Level),
color.New(color.Bold).Sprint(m.Header)),
)
color.New(color.Bold).Sprint(m.Header))
for _, line := range m.Lines {
str.WriteString(fmt.Sprintf(" %s %s\r\n", color.New(m.Color).Sprint("|"), line))
fmt.Fprintf(&str, " %s %s\r\n", color.New(m.Color).Sprint("|"), line)
}
return str.String()
}
Expand Down