fix: satisfy stricter Go 1.26.1 linter checks

Go 1.26.1 tightens a few toolchain checks that older builds tolerated.\n\nCast aliased replication status values back to their defining type before calling the generated msgp helpers, and replace Sprintf+WriteString pairs with direct Fprintf calls where needed.\n\nThese are compatibility-only source changes to keep the cmd package building cleanly under the newer linker/toolchain.
This commit is contained in:
Feng Ruohang
2026-03-21 13:43:15 +08:00
parent 5abd9a80f6
commit 377fc616d9
3 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -2128,7 +2128,7 @@ func (s *TestSuiteCommon) TestGetObjectLarge10MiB(c *check) {
1234567890,1234567890,1234567890,1234567890,1234567890,123"`
// Create 10MiB content where each line contains 1024 characters.
for i := range 10 * 1024 {
buffer.WriteString(fmt.Sprintf("[%05d] %s\n", i, line))
fmt.Fprintf(&buffer, "[%05d] %s\n", i, line)
}
putContent := buffer.String()
@@ -2190,7 +2190,7 @@ func (s *TestSuiteCommon) TestGetObjectLarge11MiB(c *check) {
1234567890,1234567890,1234567890,123`
// Create 11MiB content where each line contains 1024 characters.
for i := range 11 * 1024 {
buffer.WriteString(fmt.Sprintf("[%05d] %s\n", i, line))
fmt.Fprintf(&buffer, "[%05d] %s\n", i, line)
}
putMD5 := getMD5Hash(buffer.Bytes())
@@ -2341,7 +2341,7 @@ func (s *TestSuiteCommon) TestGetPartialObjectLarge11MiB(c *check) {
// Create 11MiB content where each line contains 1024
// characters.
for i := range 11 * 1024 {
buffer.WriteString(fmt.Sprintf("[%05d] %s\n", i, line))
fmt.Fprintf(&buffer, "[%05d] %s\n", i, line)
}
putContent := buffer.String()
@@ -2407,7 +2407,7 @@ func (s *TestSuiteCommon) TestGetPartialObjectLarge10MiB(c *check) {
1234567890,1234567890,1234567890,123`
// Create 10MiB content where each line contains 1024 characters.
for i := range 10 * 1024 {
buffer.WriteString(fmt.Sprintf("[%05d] %s\n", i, line))
fmt.Fprintf(&buffer, "[%05d] %s\n", i, line)
}
putContent := buffer.String()