mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
fix: new staticheck and linter issues reported (#19340)
This commit is contained in:
parent
cb536a73eb
commit
364d3a0ac9
@ -364,6 +364,7 @@ func TestDataUsageUpdatePrefix(t *testing.T) {
|
|||||||
}
|
}
|
||||||
if e == nil {
|
if e == nil {
|
||||||
t.Fatal("got nil result")
|
t.Fatal("got nil result")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if e.Size != int64(w.size) {
|
if e.Size != int64(w.size) {
|
||||||
t.Error("got size", e.Size, "want", w.size)
|
t.Error("got size", e.Size, "want", w.size)
|
||||||
|
@ -634,7 +634,7 @@ func TestHealingDanglingObject(t *testing.T) {
|
|||||||
defer removeRoots(fsDirs)
|
defer removeRoots(fsDirs)
|
||||||
|
|
||||||
// Everything is fine, should return nil
|
// Everything is fine, should return nil
|
||||||
objLayer, disks, err := initObjectLayer(ctx, mustGetPoolEndpoints(0, fsDirs...))
|
objLayer, _, err := initObjectLayer(ctx, mustGetPoolEndpoints(0, fsDirs...))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -650,7 +650,7 @@ func TestHealingDanglingObject(t *testing.T) {
|
|||||||
t.Fatalf("Failed to make a bucket - %v", err)
|
t.Fatalf("Failed to make a bucket - %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
disks = objLayer.(*erasureServerPools).serverPools[0].erasureDisks[0]
|
disks := objLayer.(*erasureServerPools).serverPools[0].erasureDisks[0]
|
||||||
orgDisks := append([]StorageAPI{}, disks...)
|
orgDisks := append([]StorageAPI{}, disks...)
|
||||||
|
|
||||||
// Enable versioning.
|
// Enable versioning.
|
||||||
|
@ -58,17 +58,10 @@ func TestNewServer(t *testing.T) {
|
|||||||
}
|
}
|
||||||
if server == nil {
|
if server == nil {
|
||||||
t.Fatalf("Case %v: server: expected: <non-nil>, got: <nil>", (i + 1))
|
t.Fatalf("Case %v: server: expected: <non-nil>, got: <nil>", (i + 1))
|
||||||
}
|
} else if !reflect.DeepEqual(server.Addrs, testCase.addrs) {
|
||||||
|
|
||||||
if !reflect.DeepEqual(server.Addrs, testCase.addrs) {
|
|
||||||
t.Fatalf("Case %v: server.Addrs: expected: %v, got: %v", (i + 1), testCase.addrs, server.Addrs)
|
t.Fatalf("Case %v: server.Addrs: expected: %v, got: %v", (i + 1), testCase.addrs, server.Addrs)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Interfaces are not comparable even with reflection.
|
|
||||||
// if !reflect.DeepEqual(server.Handler, testCase.handler) {
|
|
||||||
// t.Fatalf("Case %v: server.Handler: expected: %v, got: %v", (i + 1), testCase.handler, server.Handler)
|
|
||||||
// }
|
|
||||||
|
|
||||||
if testCase.certFn == nil {
|
if testCase.certFn == nil {
|
||||||
if server.TLSConfig != nil {
|
if server.TLSConfig != nil {
|
||||||
t.Fatalf("Case %v: server.TLSConfig: expected: <nil>, got: %v", (i + 1), server.TLSConfig)
|
t.Fatalf("Case %v: server.TLSConfig: expected: <nil>, got: %v", (i + 1), server.TLSConfig)
|
||||||
|
Loading…
Reference in New Issue
Block a user