diff --git a/go.mod b/go.mod
index 8aa4a41..e493174 100644
--- a/go.mod
+++ b/go.mod
@@ -7,7 +7,7 @@ require (
github.com/go-chi/chi/v5 v5.2.3
github.com/google/uuid v1.6.0
github.com/hashicorp/nomad/api v0.0.0-20250317133216-16bbdd983307
- github.com/jedib0t/go-pretty/v6 v6.7.7
+ github.com/jedib0t/go-pretty/v6 v6.7.8
github.com/rs/zerolog v1.34.0
github.com/stretchr/testify v1.11.1
)
diff --git a/go.sum b/go.sum
index 8b4c1ff..b2fe1c1 100644
--- a/go.sum
+++ b/go.sum
@@ -36,8 +36,8 @@ github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5O
github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8=
github.com/hashicorp/nomad/api v0.0.0-20250317133216-16bbdd983307 h1:dJVFZM5wiEc8XGGduWPyxa2i0NwbeeqTCoffSKXrBS0=
github.com/hashicorp/nomad/api v0.0.0-20250317133216-16bbdd983307/go.mod h1:svtxn6QnrQ69P23VvIWMR34tg3vmwLz4UdUzm1dSCgE=
-github.com/jedib0t/go-pretty/v6 v6.7.7 h1:Y1Id3lJ3k4UB8uwWWy3l8EVFnUlx5chR5+VbsofPNX0=
-github.com/jedib0t/go-pretty/v6 v6.7.7/go.mod h1:YwC5CE4fJ1HFUDeivSV1r//AmANFHyqczZk+U6BDALU=
+github.com/jedib0t/go-pretty/v6 v6.7.8 h1:BVYrDy5DPBA3Qn9ICT+PokP9cvCv1KaHv2i+Hc8sr5o=
+github.com/jedib0t/go-pretty/v6 v6.7.8/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/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_csv.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_csv.go
index e9ea5ef..8974565 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_csv.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_csv.go
@@ -36,11 +36,11 @@ func (t *Table) RenderCSV() string {
}
func (t *Table) csvFixCommas(str string) string {
- return strings.Replace(str, ",", "\\,", -1)
+ return strings.ReplaceAll(str, ",", "\\,")
}
func (t *Table) csvFixDoubleQuotes(str string) string {
- return strings.Replace(str, "\"", "\\\"", -1)
+ return strings.ReplaceAll(str, "\"", "\\\"")
}
func (t *Table) csvRenderRow(out *strings.Builder, row rowStr, hint renderHint) {
@@ -54,7 +54,7 @@ func (t *Table) csvRenderRow(out *strings.Builder, row rowStr, hint renderHint)
// auto-index column
if colIdx == 0 && t.autoIndex {
if hint.isRegularRow() {
- out.WriteString(fmt.Sprint(hint.rowNumber))
+ fmt.Fprint(out, hint.rowNumber)
}
out.WriteRune(',')
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go
index fec68f0..07b1850 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_html.go
@@ -151,7 +151,7 @@ func (t *Table) htmlRenderColumnAutoIndex(out *strings.Builder, hint renderHint)
out.WriteString("\n")
} else {
out.WriteString("
")
- out.WriteString(fmt.Sprint(hint.rowNumber))
+ fmt.Fprint(out, hint.rowNumber)
out.WriteString(" | \n")
}
}
@@ -191,10 +191,10 @@ func (t *Table) htmlRenderRow(out *strings.Builder, row rowStr, hint renderHint)
t.htmlRenderColumnAttributes(out, colIdx, hint, align)
if extraColumnsRendered > 0 {
out.WriteString(" colspan=")
- out.WriteString(fmt.Sprint(extraColumnsRendered + 1))
+ fmt.Fprint(out, extraColumnsRendered+1)
} else if rowSpan := t.shouldMergeCellsVerticallyBelow(colIdx, hint); rowSpan > 1 {
out.WriteString(" rowspan=")
- out.WriteString(fmt.Sprint(rowSpan))
+ fmt.Fprint(out, rowSpan)
}
out.WriteString(">")
if len(colStr) == 0 {
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go
index 80cdcc0..ff298b1 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_markdown.go
@@ -66,7 +66,7 @@ func (t *Table) markdownRenderRowAutoIndex(out *strings.Builder, colIdx int, hin
if hint.isSeparatorRow {
out.WriteString("---:")
} else if hint.isRegularRow() {
- out.WriteString(fmt.Sprintf("%d ", hint.rowNumber))
+ fmt.Fprintf(out, "%d ", hint.rowNumber)
}
out.WriteRune('|')
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/table/render_tsv.go b/vendor/github.com/jedib0t/go-pretty/v6/table/render_tsv.go
index 312f365..9e0c4dd 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/table/render_tsv.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/table/render_tsv.go
@@ -40,7 +40,7 @@ func (t *Table) tsvRenderRow(out *strings.Builder, row rowStr, hint renderHint)
for idx, col := range row {
if idx == 0 && t.autoIndex {
if hint.isRegularRow() {
- out.WriteString(fmt.Sprint(hint.rowNumber))
+ fmt.Fprint(out, hint.rowNumber)
}
out.WriteRune('\t')
}
@@ -51,7 +51,7 @@ func (t *Table) tsvRenderRow(out *strings.Builder, row rowStr, hint renderHint)
if strings.ContainsAny(col, "\t\n\"") || strings.Contains(col, " ") {
col = strings.ReplaceAll(col, "\"", "\"\"") // fix double-quotes
- out.WriteString(fmt.Sprintf("\"%s\"", col))
+ fmt.Fprintf(out, "\"%s\"", col)
} else {
out.WriteString(col)
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/text/ansi.go b/vendor/github.com/jedib0t/go-pretty/v6/text/ansi.go
index 6f13b65..8436ffa 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/text/ansi.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/text/ansi.go
@@ -15,18 +15,22 @@ var ANSICodesSupported = areANSICodesSupported()
// Escape("Nymeria\x1b[94mGhost\x1b[0mLady", "\x1b[91m") == "\x1b[91mNymeria\x1b[94mGhost\x1b[0m\x1b[91mLady\x1b[0m"
// Escape("Nymeria \x1b[94mGhost\x1b[0m Lady", "\x1b[91m") == "\x1b[91mNymeria \x1b[94mGhost\x1b[0m\x1b[91m Lady\x1b[0m"
func Escape(str string, escapeSeq string) string {
- out := ""
+ var out strings.Builder
+ // Estimate capacity: original string + escape sequences
+ out.Grow(len(str) + len(escapeSeq)*3 + len(EscapeReset)*2)
+
if !strings.HasPrefix(str, EscapeStart) {
- out += escapeSeq
+ out.WriteString(escapeSeq)
}
- out += strings.Replace(str, EscapeReset, EscapeReset+escapeSeq, -1)
- if !strings.HasSuffix(out, EscapeReset) {
- out += EscapeReset
+ out.WriteString(strings.ReplaceAll(str, EscapeReset, EscapeReset+escapeSeq))
+ if !strings.HasSuffix(out.String(), EscapeReset) {
+ out.WriteString(EscapeReset)
}
- if strings.Contains(out, escapeSeq+EscapeReset) {
- out = strings.Replace(out, escapeSeq+EscapeReset, "", -1)
+ result := out.String()
+ if strings.Contains(result, escapeSeq+EscapeReset) {
+ result = strings.ReplaceAll(result, escapeSeq+EscapeReset, "")
}
- return out
+ return result
}
// StripEscape strips all ANSI Escape Sequence from the string.
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/text/valign.go b/vendor/github.com/jedib0t/go-pretty/v6/text/valign.go
index f1a75e9..8e086d9 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/text/valign.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/text/valign.go
@@ -27,10 +27,11 @@ func (va VAlign) Apply(lines []string, maxLines int) []string {
maxLines = len(lines)
}
- insertIdx := 0
- if va == VAlignMiddle {
+ var insertIdx int
+ switch va {
+ case VAlignMiddle:
insertIdx = int(maxLines-len(lines)) / 2
- } else if va == VAlignBottom {
+ case VAlignBottom:
insertIdx = maxLines - len(lines)
}
diff --git a/vendor/github.com/jedib0t/go-pretty/v6/text/wrap.go b/vendor/github.com/jedib0t/go-pretty/v6/text/wrap.go
index 8a9e803..fd657f7 100644
--- a/vendor/github.com/jedib0t/go-pretty/v6/text/wrap.go
+++ b/vendor/github.com/jedib0t/go-pretty/v6/text/wrap.go
@@ -13,7 +13,7 @@ func WrapHard(str string, wrapLen int) string {
if wrapLen <= 0 {
return ""
}
- str = strings.Replace(str, "\t", " ", -1)
+ str = strings.ReplaceAll(str, "\t", " ")
sLen := StringWidthWithoutEscSequences(str)
if sLen <= wrapLen {
return str
@@ -41,7 +41,7 @@ func WrapSoft(str string, wrapLen int) string {
if wrapLen <= 0 {
return ""
}
- str = strings.Replace(str, "\t", " ", -1)
+ str = strings.ReplaceAll(str, "\t", " ")
sLen := StringWidthWithoutEscSequences(str)
if sLen <= wrapLen {
return str
@@ -68,7 +68,7 @@ func WrapText(str string, wrapLen int) string {
if wrapLen <= 0 {
return ""
}
- str = strings.Replace(str, "\t", " ", -1)
+ str = strings.ReplaceAll(str, "\t", " ")
sLen := StringWidthWithoutEscSequences(str)
if sLen <= wrapLen {
return str
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 88d37cc..a264f5c 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -50,7 +50,7 @@ github.com/hashicorp/go-rootcerts
## explicit; go 1.20
github.com/hashicorp/nomad/api
github.com/hashicorp/nomad/api/contexts
-# github.com/jedib0t/go-pretty/v6 v6.7.7
+# github.com/jedib0t/go-pretty/v6 v6.7.8
## explicit; go 1.18
github.com/jedib0t/go-pretty/v6/table
github.com/jedib0t/go-pretty/v6/text