Skip to content

Commit

Permalink
Merge pull request #837 from ripienaar/trim_column_sep
Browse files Browse the repository at this point in the history
Trim double column seps from row titles
  • Loading branch information
ripienaar authored Aug 8, 2023
2 parents fed3450 + 21b6bc4 commit 7257faa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion columns/columns.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (w *Writer) Render() (string, error) {

// AddRow adds a row, v will be formatted if time.Time, time.Duration, []string, floats, ints and uints
func (w *Writer) AddRow(t string, v any) {
w.rows = append(w.rows, &columnRow{kind: kindRow, values: []any{t, F(v)}})
w.rows = append(w.rows, &columnRow{kind: kindRow, values: []any{strings.TrimSuffix(t, w.sep), F(v)}})
}

// AddRowIf adds a row if the condition is true
Expand Down

0 comments on commit 7257faa

Please sign in to comment.