use strings.Lines() iterator

This commit is contained in:
2026-07-13 12:40:31 +02:00
parent 3a75ad847b
commit 9dd6bcbc89

View File

@@ -149,9 +149,11 @@ func (table *Table) PrintTSV() error {
wrapped := wrapper(entry) wrapped := wrapper(entry)
// and indent it // and indent it
for idx, line := range strings.Split(wrapped, "\n") { first := true
if idx == 0 { for line := range strings.Lines(wrapped) {
if first {
entry = line entry = line
first = false
} else { } else {
entry += "\n " + strings.Repeat(" ", currentWidth) + line entry += "\n " + strings.Repeat(" ", currentWidth) + line
} }