From ef2a448dee75b4d59300d8c634ea6748c4e685d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jun 2026 09:23:51 +0000 Subject: [PATCH] build(deps): bump github.com/jedib0t/go-pretty/v6 from 6.8.1 to 6.8.2 Bumps [github.com/jedib0t/go-pretty/v6](https://github.com/jedib0t/go-pretty) from 6.8.1 to 6.8.2. - [Release notes](https://github.com/jedib0t/go-pretty/releases) - [Commits](https://github.com/jedib0t/go-pretty/compare/v6.8.1...v6.8.2) --- updated-dependencies: - dependency-name: github.com/jedib0t/go-pretty/v6 dependency-version: 6.8.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../jedib0t/go-pretty/v6/text/string.go | 24 +++++++++++++------ vendor/modules.txt | 2 +- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index f2d20754..b9eb1d1b 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/gin-gonic/gin v1.12.0 github.com/go-logr/logr v1.4.3 github.com/go-logr/stdr v1.2.2 - github.com/jedib0t/go-pretty/v6 v6.8.1 + github.com/jedib0t/go-pretty/v6 v6.8.2 github.com/kubeservice-stack/common v1.10.0 github.com/mholt/archiver/v4 v4.0.0-alpha.9 github.com/oklog/run v1.2.0 diff --git a/go.sum b/go.sum index 519dda74..61c15726 100644 --- a/go.sum +++ b/go.sum @@ -270,8 +270,8 @@ github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyf github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jedib0t/go-pretty/v6 v6.8.1 h1:0fkCNhjrX0zPpwkWaDYU5VMrygg41Tu197mWILIJoqQ= -github.com/jedib0t/go-pretty/v6 v6.8.1/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= +github.com/jedib0t/go-pretty/v6 v6.8.2 h1:FmKNr1GOyot/zqNQplE8HLhFguJaeHJTCArntnI4uxE= +github.com/jedib0t/go-pretty/v6 v6.8.2/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= diff --git a/vendor/github.com/jedib0t/go-pretty/v6/text/string.go b/vendor/github.com/jedib0t/go-pretty/v6/text/string.go index d8b30845..7902b0e0 100644 --- a/vendor/github.com/jedib0t/go-pretty/v6/text/string.go +++ b/vendor/github.com/jedib0t/go-pretty/v6/text/string.go @@ -286,13 +286,16 @@ func StringWidthWithoutEscSequences(str string) int { return count } -// Trim trims a string to the given length while ignoring escape sequences. For -// ex.: +// Trim trims a string to the given display width (maxLen columns) while +// ignoring escape sequences. Wide East Asian characters count as two columns, +// so the result never exceeds maxLen columns. For ex.: // // Trim("Ghost", 3) == "Gho" // Trim("Ghost", 6) == "Ghost" // Trim("\x1b[33mGhost\x1b[0m", 3) == "\x1b[33mGho\x1b[0m" // Trim("\x1b[33mGhost\x1b[0m", 6) == "\x1b[33mGhost\x1b[0m" +// Trim("生命生命", 3) == "生" +// Trim("生命生命", 4) == "生命" func Trim(str string, maxLen int) string { if maxLen <= 0 { return "" @@ -301,7 +304,7 @@ func Trim(str string, maxLen int) string { var out strings.Builder out.Grow(maxLen) - outLen, esp := 0, EscSeqParser{} + outLen, full, esp := 0, false, EscSeqParser{} for _, sChr := range str { if esp.InSequence() { esp.Consume(sChr) @@ -313,10 +316,17 @@ func Trim(str string, maxLen int) string { out.WriteRune(sChr) continue } - if outLen < maxLen { - outLen++ - out.WriteRune(sChr) - continue + // Count the display width of the rune (wide East Asian characters + // occupy two columns) instead of counting runes, so the result never + // exceeds maxLen columns. Once a rune no longer fits, stop emitting + // visible runes but keep copying any trailing escape sequences. + if !full { + if w := RuneWidth(sChr); outLen+w <= maxLen { + outLen += w + out.WriteRune(sChr) + continue + } + full = true } } return out.String() diff --git a/vendor/modules.txt b/vendor/modules.txt index d8ca7ac5..beaf1af1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -373,7 +373,7 @@ github.com/hashicorp/golang-lru/v2/simplelru # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap -# github.com/jedib0t/go-pretty/v6 v6.8.1 +# github.com/jedib0t/go-pretty/v6 v6.8.2 ## explicit; go 1.18 github.com/jedib0t/go-pretty/v6/table github.com/jedib0t/go-pretty/v6/text