Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

go fmt

Chris Lua3cb7fa8ccf3
diff --git a/weed/admin/dash/admin_server.go b/weed/admin/dash/admin_server.go
index d0f982189f..7415481221 100644
--- a/weed/admin/dash/admin_server.go
+++ b/weed/admin/dash/admin_server.go
@@ -3,10 +3,6 @@ package dash
import (
"context"
"fmt"
- "net/http"
- "sort"
- "strings"
- "time"
"github.com/seaweedfs/seaweedfs/weed/admin/maintenance"
adminplugin "github.com/seaweedfs/seaweedfs/weed/admin/plugin"
"github.com/seaweedfs/seaweedfs/weed/cluster"
@@ -23,6 +19,10 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
"google.golang.org/grpc"
+ "net/http"
+ "sort"
+ "strings"
+ "time"
"github.com/seaweedfs/seaweedfs/weed/s3api"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
diff --git a/weed/iamapi/iamapi_management_handlers_test.go b/weed/iamapi/iamapi_management_handlers_test.go
index 1b75d58ead..2a814a0e82 100644
--- a/weed/iamapi/iamapi_management_handlers_test.go
+++ b/weed/iamapi/iamapi_management_handlers_test.go
@@ -241,13 +241,13 @@ func TestMultipleInlinePoliciesAggregateActions(t *testing.T) {
// Check that alice now has aggregated actions from both policies
// Should include Read and List (from policy1) and Write (from policy2)
// with resource paths indicating which policy they came from
-
+
// Build a set of actual action strings for exact membership checks
actionSet := make(map[string]bool)
for _, action := range aliceIdent.Actions {
actionSet[action] = true
}
-
+
// Expected actions from both policies:
// - policy1: GetObject, ListBucket on bucket-a/* → "Read:bucket-a/*", "List:bucket-a/*"
// - policy2: PutObject on bucket-b/* → "Write:bucket-b/*"
@@ -256,7 +256,7 @@ func TestMultipleInlinePoliciesAggregateActions(t *testing.T) {
"List:bucket-a/*",
"Write:bucket-b/*",
}
-
+
for _, expectedAction := range expectedActions {
assert.True(t, actionSet[expectedAction], "Expected action '%s' not found in aggregated actions. Got: %v", expectedAction, aliceIdent.Actions)
}
diff --git a/weed/shell/command_volume_merge_test.go b/weed/shell/command_volume_merge_test.go
index af0b1d1fa7..0ba72b7526 100644
--- a/weed/shell/command_volume_merge_test.go
+++ b/weed/shell/command_volume_merge_test.go
@@ -110,13 +110,13 @@ func TestMergeNeedleStreamsSameStreamDuplicates(t *testing.T) {
// Deduplication should only skip cross-stream duplicates, not same-stream overwrites
const (
baseLine = uint64(0)
- twoSecs = uint64(2_000_000_000) // 2 seconds
+ twoSecs = uint64(2_000_000_000) // 2 seconds
threeSecs = uint64(3_000_000_000) // 3 seconds
)
// Stream A has multiple writes of the same needle ID (overwrites within same stream)
streamA := &sliceNeedleStream{needles: []*needle.Needle{
- {Id: 10, AppendAtNs: baseLine}, // First write at t=0
+ {Id: 10, AppendAtNs: baseLine}, // First write at t=0
{Id: 10, AppendAtNs: baseLine + twoSecs}, // Second write (overwrite) at t=2s - same stream!
{Id: 10, AppendAtNs: baseLine + threeSecs}, // Third write (overwrite) at t=3s - same stream!
}}
@@ -141,7 +141,7 @@ func TestMergeNeedleStreamsSameStreamDuplicates(t *testing.T) {
// (it occurs between t=0 and t=5s window, and data from streamA takes precedence since seen first in window)
// Timeline: t=0: A@10, t=1s: B@10 (skip - cross-stream dup), t=2s: A@10, t=3s: A@10
want := []seenNeedle{
- {id: 10, ts: baseLine}, // From streamA at t=0
+ {id: 10, ts: baseLine}, // From streamA at t=0
{id: 10, ts: baseLine + twoSecs}, // From streamA at t=2s (same-stream overwrite, kept)
{id: 10, ts: baseLine + threeSecs}, // From streamA at t=3s (same-stream overwrite, kept)
}