Skip to content

Commit 9723c16

Browse files
committed
go: update to 1.26.0 and code tidy
1 parent f250d18 commit 9723c16

File tree

6 files changed

+43
-49
lines changed

6 files changed

+43
-49
lines changed

go.mod

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/antgroup/hugescm
22

3-
go 1.25
3+
go 1.26
44

55
require (
66
github.com/BurntSushi/toml v1.6.0
@@ -26,7 +26,7 @@ require (
2626
github.com/rivo/uniseg v0.4.7
2727
github.com/sirupsen/logrus v1.9.4
2828
github.com/stretchr/testify v1.11.1
29-
github.com/vbauerster/mpb/v8 v8.11.3
29+
github.com/vbauerster/mpb/v8 v8.12.0
3030
github.com/zeebo/blake3 v0.2.4
3131
golang.org/x/crypto v0.48.0
3232
golang.org/x/net v0.50.0
@@ -37,20 +37,19 @@ require (
3737
)
3838

3939
require (
40-
filippo.io/edwards25519 v1.1.0 // indirect
40+
filippo.io/edwards25519 v1.2.0 // indirect
4141
github.com/VividCortex/ewma v1.2.0 // indirect
4242
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
4343
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
4444
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
4545
github.com/cespare/xxhash/v2 v2.3.0 // indirect
46-
github.com/charmbracelet/colorprofile v0.4.1 // indirect
46+
github.com/charmbracelet/colorprofile v0.4.2 // indirect
4747
github.com/charmbracelet/x/ansi v0.11.6 // indirect
4848
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
4949
github.com/charmbracelet/x/term v0.2.2 // indirect
50-
github.com/clipperhouse/displaywidth v0.9.0 // indirect
51-
github.com/clipperhouse/stringish v0.1.1 // indirect
52-
github.com/clipperhouse/uax29/v2 v2.5.0 // indirect
53-
github.com/cloudflare/circl v1.6.2 // indirect
50+
github.com/clipperhouse/displaywidth v0.11.0 // indirect
51+
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
52+
github.com/cloudflare/circl v1.6.3 // indirect
5453
github.com/davecgh/go-spew v1.1.1 // indirect
5554
github.com/dustin/go-humanize v1.0.1 // indirect
5655
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
@@ -59,7 +58,7 @@ require (
5958
github.com/mattn/go-colorable v0.1.14 // indirect
6059
github.com/mattn/go-isatty v0.0.20 // indirect
6160
github.com/mattn/go-localereader v0.0.1 // indirect
62-
github.com/mattn/go-runewidth v0.0.19 // indirect
61+
github.com/mattn/go-runewidth v0.0.20 // indirect
6362
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
6463
github.com/muesli/cancelreader v0.2.2 // indirect
6564
github.com/muesli/termenv v0.16.0 // indirect

go.sum

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
2-
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
1+
filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo=
2+
filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc=
33
github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk=
44
github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
55
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
@@ -20,8 +20,8 @@ github.com/charmbracelet/bubbles v1.0.0 h1:12J8/ak/uCZEMQ6KU7pcfwceyjLlWsDLAxB5f
2020
github.com/charmbracelet/bubbles v1.0.0/go.mod h1:9d/Zd5GdnauMI5ivUIVisuEm3ave1XwXtD1ckyV6r3E=
2121
github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
2222
github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4=
23-
github.com/charmbracelet/colorprofile v0.4.1 h1:a1lO03qTrSIRaK8c3JRxJDZOvhvIeSco3ej+ngLk1kk=
24-
github.com/charmbracelet/colorprofile v0.4.1/go.mod h1:U1d9Dljmdf9DLegaJ0nGZNJvoXAhayhmidOdcBwAvKk=
23+
github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY=
24+
github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8=
2525
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
2626
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
2727
github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8=
@@ -30,14 +30,12 @@ github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMx
3030
github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q=
3131
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
3232
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
33-
github.com/clipperhouse/displaywidth v0.9.0 h1:Qb4KOhYwRiN3viMv1v/3cTBlz3AcAZX3+y9OLhMtAtA=
34-
github.com/clipperhouse/displaywidth v0.9.0/go.mod h1:aCAAqTlh4GIVkhQnJpbL0T/WfcrJXHcj8C0yjYcjOZA=
35-
github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs=
36-
github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA=
37-
github.com/clipperhouse/uax29/v2 v2.5.0 h1:x7T0T4eTHDONxFJsL94uKNKPHrclyFI0lm7+w94cO8U=
38-
github.com/clipperhouse/uax29/v2 v2.5.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g=
39-
github.com/cloudflare/circl v1.6.2 h1:hL7VBpHHKzrV5WTfHCaBsgx/HGbBYlgrwvNXEVDYYsQ=
40-
github.com/cloudflare/circl v1.6.2/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
33+
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
34+
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
35+
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
36+
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
37+
github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8=
38+
github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4=
4139
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
4240
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
4341
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
@@ -90,8 +88,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
9088
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
9189
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
9290
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
93-
github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
94-
github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
91+
github.com/mattn/go-runewidth v0.0.20 h1:WcT52H91ZUAwy8+HUkdM3THM6gXqXuLJi9O3rjcQQaQ=
92+
github.com/mattn/go-runewidth v0.0.20/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
9593
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
9694
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
9795
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
@@ -116,8 +114,8 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
116114
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
117115
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
118116
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
119-
github.com/vbauerster/mpb/v8 v8.11.3 h1:iniBmO4ySXCl4gVdmJpgrtormH5uvjpxcx/dMyVU9Jw=
120-
github.com/vbauerster/mpb/v8 v8.11.3/go.mod h1:n9M7WbP0NFjpgKS5XdEC3tMRgZTNM/xtC8zWGkiMuy0=
117+
github.com/vbauerster/mpb/v8 v8.12.0 h1:+gneY3ifzc88tKDzOtfG8k8gfngCx615S2ZmFM4liWg=
118+
github.com/vbauerster/mpb/v8 v8.12.0/go.mod h1:V02YIuMVo301Y1VE9VtZlD8s84OMsk+EKN6mwvf/588=
121119
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
122120
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
123121
github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY=

modules/lfs/pointer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ func (p *Pointer) Encoded() string {
8282
}
8383

8484
var buffer bytes.Buffer
85-
buffer.WriteString(fmt.Sprintf("version %s\n", latest))
85+
fmt.Fprintf(&buffer, "version %s\n", latest)
8686
for _, ext := range p.Extensions {
87-
buffer.WriteString(fmt.Sprintf("ext-%d-%s %s:%s\n", ext.Priority, ext.Name, ext.OidType, ext.Oid))
87+
fmt.Fprintf(&buffer, "ext-%d-%s %s:%s\n", ext.Priority, ext.Name, ext.OidType, ext.Oid)
8888
}
89-
buffer.WriteString(fmt.Sprintf("oid %s:%s\n", p.OidType, p.Oid))
90-
buffer.WriteString(fmt.Sprintf("size %d\n", p.Size))
89+
fmt.Fprintf(&buffer, "oid %s:%s\n", p.OidType, p.Oid)
90+
fmt.Fprintf(&buffer, "size %d\n", p.Size)
9191
return buffer.String()
9292
}
9393

modules/merkletrie/internal/frame/frame.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func (f *Frame) String() string {
5454
for i := f.Len() - 1; i >= 0; i-- {
5555
_, _ = buf.WriteString(sep)
5656
sep = ", "
57-
_, _ = buf.WriteString(fmt.Sprintf("%q", f.stack[i].Name()))
57+
_, _ = fmt.Fprintf(&buf, "%q", f.stack[i].Name())
5858
}
5959

6060
_ = buf.WriteByte(']')

modules/progressbar/progressbar.go

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -778,15 +778,15 @@ func (p *ProgressBar) renderDetails() error {
778778

779779
// render the details row
780780
for _, detail := range p.state.details {
781-
b.WriteString(fmt.Sprintf("\u001B[K\r%s\n", detail))
781+
fmt.Fprintf(&b, "\u001B[K\r%s\n", detail)
782782
}
783783
// add empty lines to fill the maxDetailRow
784784
for i := len(p.state.details); i < p.config.maxDetailRow; i++ {
785785
b.WriteString("\u001B[K\n")
786786
}
787787

788788
// move the cursor up to the start of the details row
789-
b.WriteString(fmt.Sprintf("\u001B[%dF", p.config.maxDetailRow+1))
789+
fmt.Fprintf(&b, "\u001B[%dF", p.config.maxDetailRow+1)
790790

791791
_ = writeString(p.config, b.String())
792792

@@ -1065,31 +1065,28 @@ func renderProgressBar(c config, s *state) (int, error) {
10651065
currentHumanize, currentSuffix := humanizeBytes(s.currentBytes, c.useIECUnits)
10661066
if currentSuffix == c.maxHumanizedSuffix {
10671067
if c.showTotalBytes {
1068-
sb.WriteString(fmt.Sprintf("%s/%s%s",
1069-
currentHumanize, c.maxHumanized, c.maxHumanizedSuffix))
1068+
fmt.Fprintf(&sb, "%s/%s%s", currentHumanize, c.maxHumanized, c.maxHumanizedSuffix)
10701069
} else {
1071-
sb.WriteString(fmt.Sprintf("%s%s",
1072-
currentHumanize, c.maxHumanizedSuffix))
1070+
fmt.Fprintf(&sb, "%s%s", currentHumanize, c.maxHumanizedSuffix)
10731071
}
10741072
} else if c.showTotalBytes {
1075-
sb.WriteString(fmt.Sprintf("%s%s/%s%s",
1076-
currentHumanize, currentSuffix, c.maxHumanized, c.maxHumanizedSuffix))
1073+
fmt.Fprintf(&sb, "%s%s/%s%s", currentHumanize, currentSuffix, c.maxHumanized, c.maxHumanizedSuffix)
10771074
} else {
1078-
sb.WriteString(fmt.Sprintf("%s%s", currentHumanize, currentSuffix))
1075+
fmt.Fprintf(&sb, "%s%s", currentHumanize, currentSuffix)
10791076
}
10801077
} else if c.showTotalBytes {
1081-
sb.WriteString(fmt.Sprintf("%.0f/%d", s.currentBytes, c.max))
1078+
fmt.Fprintf(&sb, "%.0f/%d", s.currentBytes, c.max)
10821079
} else {
1083-
sb.WriteString(fmt.Sprintf("%.0f", s.currentBytes))
1080+
fmt.Fprintf(&sb, "%.0f", s.currentBytes)
10841081
}
10851082
} else {
10861083
if c.showBytes {
10871084
currentHumanize, currentSuffix := humanizeBytes(s.currentBytes, c.useIECUnits)
1088-
sb.WriteString(fmt.Sprintf("%s%s", currentHumanize, currentSuffix))
1085+
fmt.Fprintf(&sb, "%s%s", currentHumanize, currentSuffix)
10891086
} else if c.showTotalBytes {
1090-
sb.WriteString(fmt.Sprintf("%.0f/%s", s.currentBytes, "-"))
1087+
fmt.Fprintf(&sb, "%.0f/%s", s.currentBytes, "-")
10911088
} else {
1092-
sb.WriteString(fmt.Sprintf("%.0f", s.currentBytes))
1089+
fmt.Fprintf(&sb, "%.0f", s.currentBytes)
10931090
}
10941091
}
10951092
}
@@ -1102,7 +1099,7 @@ func renderProgressBar(c config, s *state) (int, error) {
11021099
sb.WriteString(", ")
11031100
}
11041101
currentHumanize, currentSuffix := humanizeBytes(averageRate, c.useIECUnits)
1105-
sb.WriteString(fmt.Sprintf("%s%s/s", currentHumanize, currentSuffix))
1102+
fmt.Fprintf(&sb, "%s%s/s", currentHumanize, currentSuffix)
11061103
}
11071104

11081105
// show iterations rate
@@ -1113,11 +1110,11 @@ func renderProgressBar(c config, s *state) (int, error) {
11131110
sb.WriteString(", ")
11141111
}
11151112
if averageRate > 1 {
1116-
sb.WriteString(fmt.Sprintf("%0.0f %s/s", averageRate, c.iterationString))
1113+
fmt.Fprintf(&sb, "%0.0f %s/s", averageRate, c.iterationString)
11171114
} else if averageRate*60 > 1 {
1118-
sb.WriteString(fmt.Sprintf("%0.0f %s/min", 60*averageRate, c.iterationString))
1115+
fmt.Fprintf(&sb, "%0.0f %s/min", 60*averageRate, c.iterationString)
11191116
} else {
1120-
sb.WriteString(fmt.Sprintf("%0.0f %s/hr", 3600*averageRate, c.iterationString))
1117+
fmt.Fprintf(&sb, "%0.0f %s/hr", 3600*averageRate, c.iterationString)
11211118
}
11221119
}
11231120
if sb.Len() > 0 {

pkg/serve/database/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type Command struct {
7878
ReferenceName plumbing.ReferenceName `json:"reference_name"`
7979
OldRev string `json:"old_rev"`
8080
NewRev string `json:"new_rev"`
81-
Subject string `json:"subject,"`
81+
Subject string `json:"subject"`
8282
Description string `json:"description"`
8383
RID int64 `json:"rid"`
8484
UID int64 `json:"uid"`

0 commit comments

Comments
 (0)