Skip to content

Commit ad8f711

Browse files
committed
cleanup warp
1 parent 5770509 commit ad8f711

File tree

4 files changed

+16
-50
lines changed

4 files changed

+16
-50
lines changed

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ go 1.21
55
require (
66
github.com/fatih/color v1.15.0
77
github.com/mattn/go-runewidth v0.0.16
8-
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6
8+
github.com/olekukonko/errors v1.1.0
9+
github.com/olekukonko/ll v0.0.9
10+
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0
11+
github.com/rivo/uniseg v0.2.0
912
)
1013

1114
require (
1215
github.com/mattn/go-colorable v0.1.13 // indirect
1316
github.com/mattn/go-isatty v0.0.19 // indirect
14-
github.com/olekukonko/ll v0.0.8 // indirect
15-
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0 // indirect
16-
github.com/rivo/uniseg v0.2.0 // indirect
1717
golang.org/x/sys v0.12.0 // indirect
1818
)

go.sum

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,10 @@ github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APP
77
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
88
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
99
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
10-
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6 h1:r3FaAI0NZK3hSmtTDrBVREhKULp8oUeqLT5Eyl2mSPo=
11-
github.com/olekukonko/errors v0.0.0-20250405072817-4e6d85265da6/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
12-
github.com/olekukonko/ll v0.0.0-20250507172320-ea747e008e73 h1:Gqgp4clii9OWN5xgc8OwaD57qHx+zM4fXPIxB4QC3Zk=
13-
github.com/olekukonko/ll v0.0.0-20250507172320-ea747e008e73/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
14-
github.com/olekukonko/ll v0.0.0-20250509084555-6eba43302332 h1:n5y0nbsA071TLIuVUFjz1nPBPi0RoWe/xelq4jsbvaU=
15-
github.com/olekukonko/ll v0.0.0-20250509084555-6eba43302332/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
16-
github.com/olekukonko/ll v0.0.0-20250509110120-b54a09ca9f96 h1:za5DfBlQMgVn0XJUN34kzssuW0MUzIVHXLaR/PDZwyw=
17-
github.com/olekukonko/ll v0.0.0-20250509110120-b54a09ca9f96/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
18-
github.com/olekukonko/ll v0.0.0-20250510115240-15382ceb1b19 h1:KS8mPZS4LMxG83NIMVka44XDsM7UpTTKIqGWMnRe7Xc=
19-
github.com/olekukonko/ll v0.0.0-20250510115240-15382ceb1b19/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
20-
github.com/olekukonko/ll v0.0.0-20250510133129-b58cd384cb8f h1:dOY4AnSWDfF3gLxwxnbNUAF7EEKPUmLRlqXPakmdyn4=
21-
github.com/olekukonko/ll v0.0.0-20250510133129-b58cd384cb8f/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
22-
github.com/olekukonko/ll v0.0.0-20250510142951-0783ae1ab997 h1:chuSUEauzoEqa7MIGefWSARCurGBbwohTPQYK1zSync=
23-
github.com/olekukonko/ll v0.0.0-20250510142951-0783ae1ab997/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
24-
github.com/olekukonko/ll v0.0.0-20250510164409-ceb6a13d91b7 h1:N4G1sMmKuHIZ6aZEhjosieSKhOUvKUN2xdotI+wqoVU=
25-
github.com/olekukonko/ll v0.0.0-20250510164409-ceb6a13d91b7/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
26-
github.com/olekukonko/ll v0.0.6-0.20250511102614-9564773e9d27 h1:LgDwLQDELPB6wMOx1x4DSXnH2pjQNDKFgqv2inJuiAU=
27-
github.com/olekukonko/ll v0.0.6-0.20250511102614-9564773e9d27/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
28-
github.com/olekukonko/ll v0.0.6-0.20250513000243-3b679d30b046 h1:LHNAHSvMNNAYbh5Rj+RcR2BJrQ3PH3KKc3Db+ktanO4=
29-
github.com/olekukonko/ll v0.0.6-0.20250513000243-3b679d30b046/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
30-
github.com/olekukonko/ll v0.0.6-0.20250513000539-a956e85bdb0e h1:MkLJt4HgQw7HAWjzPdA8bBgpIKjGxIGjpy2316gN1eU=
31-
github.com/olekukonko/ll v0.0.6-0.20250513000539-a956e85bdb0e/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
32-
github.com/olekukonko/ll v0.0.6-0.20250513001635-5dbed4661872 h1:44lc4ASGSoHddTt0yClHvlqWm50vzXPE1LkkPQxj8kc=
33-
github.com/olekukonko/ll v0.0.6-0.20250513001635-5dbed4661872/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
34-
github.com/olekukonko/ll v0.0.6-0.20250513034024-62c5c2714b38 h1:Lnuzuijce7bnRJnlns11a2mUTW9lMF5kUW+ZriZh/hI=
35-
github.com/olekukonko/ll v0.0.6-0.20250513034024-62c5c2714b38/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
36-
github.com/olekukonko/ll v0.0.7 h1:K66xcUlG2qWRhPoLw/cidmbv4pDDJtZuvJGsR5QTzXo=
37-
github.com/olekukonko/ll v0.0.7/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
38-
github.com/olekukonko/ll v0.0.8-0.20250516000150-d68806778337 h1:UyQ9e528yarbqDlJ2k3LHdOrjbLJD4n930urUM6t5u4=
39-
github.com/olekukonko/ll v0.0.8-0.20250516000150-d68806778337/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
40-
github.com/olekukonko/ll v0.0.8-0.20250516001244-1c9e058e90b6 h1:0rbVA8or3kK/eRrNdHcshP5aC6WvvUjcZawf08QlqR4=
41-
github.com/olekukonko/ll v0.0.8-0.20250516001244-1c9e058e90b6/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
42-
github.com/olekukonko/ll v0.0.8-0.20250516010636-22ea57d81985 h1:V2wKiwjwAfRJRtUP6pC7wt4opeF14enO0du2dRV6Llo=
43-
github.com/olekukonko/ll v0.0.8-0.20250516010636-22ea57d81985/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
44-
github.com/olekukonko/ll v0.0.8 h1:sbGZ1Fx4QxJXEqL/6IG8GEFnYojUSQ45dJVwN2FH2fc=
45-
github.com/olekukonko/ll v0.0.8/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
10+
github.com/olekukonko/errors v1.1.0 h1:RNuGIh15QdDenh+hNvKrJkmxxjV4hcS50Db478Ou5sM=
11+
github.com/olekukonko/errors v1.1.0/go.mod h1:ppzxA5jBKcO1vIpCXQ9ZqgDh8iwODz6OXIGKU8r5m4Y=
12+
github.com/olekukonko/ll v0.0.9 h1:Y+1YqDfVkqMWuEQMclsF9HUR5+a82+dxJuL1HHSRpxI=
13+
github.com/olekukonko/ll v0.0.9/go.mod h1:En+sEW0JNETl26+K8eZ6/W4UQ7CYSrrgg/EdIYT2H8g=
4614
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0 h1:LiZB1h0GIcudcDci2bxbqI6DXV8bF8POAnArqvRrIyw=
4715
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0/go.mod h1:F/7q8/HZz+TXjlsoZQQKVYvXTZaFH4QRa3y+j1p7MS0=
4816
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=

stream.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package tablewriter
22

33
import (
4-
"fmt"
54
"github.com/olekukonko/errors"
65
"github.com/olekukonko/tablewriter/pkg/twwidth"
76
"github.com/olekukonko/tablewriter/tw"
@@ -90,7 +89,7 @@ func (t *Table) Start() error {
9089
if !t.renderer.Config().Streaming {
9190
// Check if the configured renderer actually supports streaming.
9291
t.logger.Error("Configured renderer does not support streaming.")
93-
return fmt.Errorf("renderer does not support streaming")
92+
return errors.Newf("renderer does not support streaming")
9493
}
9594

9695
//t.renderer.Start(t.writer)
@@ -208,7 +207,7 @@ func (t *Table) streamAppendRow(row interface{}) error {
208207
rawCellsSlice, err := t.convertCellsToStrings(row, t.config.Row)
209208
if err != nil {
210209
t.logger.Errorf("streamAppendRow: Failed to convert row to strings: %v", err)
211-
return fmt.Errorf("failed to convert row to strings: %w", err)
210+
return errors.Newf("failed to convert row to strings").Wrap(err)
212211
}
213212

214213
if len(rawCellsSlice) == 0 {
@@ -221,7 +220,7 @@ func (t *Table) streamAppendRow(row interface{}) error {
221220
}
222221

223222
if err := t.ensureStreamWidthsCalculated(rawCellsSlice, t.config.Row); err != nil {
224-
return fmt.Errorf("failed to establish stream column count/widths: %w", err)
223+
return errors.New("failed to establish stream column count/widths").Wrap(err)
225224
}
226225

227226
// Now, check for column mismatch if a column count has been established.

tablewriter.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package tablewriter
22

33
import (
44
"bytes"
5-
"fmt"
65
"github.com/olekukonko/errors"
76
"github.com/olekukonko/ll"
87
"github.com/olekukonko/ll/lh"
@@ -194,7 +193,7 @@ func (t *Table) Append(rows ...interface{}) error {
194193
}
195194
if err := t.streamAppendRow(rowItemForStream); err != nil {
196195
t.logger.Errorf("Error rendering streaming row: %v", err)
197-
return fmt.Errorf("failed to stream append row: %w", err)
196+
return errors.Newf("failed to stream append row").Wrap(err)
198197
}
199198
return nil
200199
}
@@ -1405,13 +1404,13 @@ func (t *Table) render() error {
14051404
if err != nil {
14061405
t.writer = originalWriter
14071406
t.logger.Errorf("prepareContexts failed: %v", err)
1408-
return fmt.Errorf("failed to prepare table contexts: %w", err)
1407+
return errors.Newf("failed to prepare table contexts").Wrap(err)
14091408
}
14101409

14111410
if err := ctx.renderer.Start(t.writer); err != nil {
14121411
t.writer = originalWriter
14131412
t.logger.Errorf("Renderer Start() error: %v", err)
1414-
return fmt.Errorf("renderer start failed: %w", err)
1413+
return errors.Newf("renderer start failed").Wrap(err)
14151414
}
14161415

14171416
renderError := false
@@ -1426,7 +1425,7 @@ func (t *Table) render() error {
14261425
if renderErr := renderFn(ctx, mctx); renderErr != nil {
14271426
t.logger.Errorf("Renderer section error (%s): %v", sectionName, renderErr)
14281427
if !renderError {
1429-
firstRenderErr = fmt.Errorf("failed to render %s section: %w", sectionName, renderErr)
1428+
firstRenderErr = errors.Newf("failed to render %s section", sectionName).Wrap(renderErr)
14301429
}
14311430
renderError = true
14321431
break
@@ -1436,7 +1435,7 @@ func (t *Table) render() error {
14361435
if closeErr := ctx.renderer.Close(); closeErr != nil {
14371436
t.logger.Errorf("Renderer Close() error: %v", closeErr)
14381437
if !renderError {
1439-
firstRenderErr = fmt.Errorf("renderer close failed: %w", closeErr)
1438+
firstRenderErr = errors.Newf("renderer close failed").Wrap(closeErr)
14401439
}
14411440
renderError = true
14421441
}

0 commit comments

Comments
 (0)