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.

chore: execute goimports to format the code (#7983)

promalert9012069bd7a9
diff --git a/other/mq_client_example/agent_pub_record/agent_pub_record.go b/other/mq_client_example/agent_pub_record/agent_pub_record.go
index 48e78f5308..8f93281c52 100644
--- a/other/mq_client_example/agent_pub_record/agent_pub_record.go
+++ b/other/mq_client_example/agent_pub_record/agent_pub_record.go
@@ -3,13 +3,14 @@ package main
import (
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/other/mq_client_example/example"
- "github.com/seaweedfs/seaweedfs/weed/mq/client/agent_client"
- "github.com/seaweedfs/seaweedfs/weed/mq/schema"
"log"
"sync"
"sync/atomic"
"time"
+
+ "github.com/seaweedfs/seaweedfs/other/mq_client_example/example"
+ "github.com/seaweedfs/seaweedfs/weed/mq/client/agent_client"
+ "github.com/seaweedfs/seaweedfs/weed/mq/schema"
)
var (
diff --git a/other/mq_client_example/agent_sub_record/agent_sub_record.go b/other/mq_client_example/agent_sub_record/agent_sub_record.go
index 21c74a46d4..bc807b3cc1 100644
--- a/other/mq_client_example/agent_sub_record/agent_sub_record.go
+++ b/other/mq_client_example/agent_sub_record/agent_sub_record.go
@@ -3,13 +3,14 @@ package main
import (
"flag"
"fmt"
+ "log"
+ "time"
+
"github.com/seaweedfs/seaweedfs/other/mq_client_example/example"
"github.com/seaweedfs/seaweedfs/weed/mq/client/agent_client"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
- "log"
- "time"
)
var (
diff --git a/seaweedfs-rdma-sidecar/pkg/rdma/client.go b/seaweedfs-rdma-sidecar/pkg/rdma/client.go
index 156bb54971..08ad760421 100644
--- a/seaweedfs-rdma-sidecar/pkg/rdma/client.go
+++ b/seaweedfs-rdma-sidecar/pkg/rdma/client.go
@@ -419,7 +419,7 @@ func (c *Client) Read(ctx context.Context, req *ReadRequest) (*ReadResponse, err
}).Info("✅ RDMA read completed successfully")
// MOCK DATA IMPLEMENTATION - FOR DEVELOPMENT/TESTING ONLY
- //
+ //
// This section generates placeholder data for the mock RDMA implementation.
// In a production RDMA implementation, this should be replaced with:
//
@@ -472,7 +472,7 @@ func (c *Client) ReadFileRange(ctx context.Context, fileID string, offset, size
if err != nil {
return nil, fmt.Errorf("invalid file ID %s: %w", fileID, err)
}
-
+
req := &ReadRequest{
VolumeID: volumeID,
NeedleID: needleID,
diff --git a/seaweedfs-rdma-sidecar/pkg/seaweedfs/client.go b/seaweedfs-rdma-sidecar/pkg/seaweedfs/client.go
index 5073c349a2..22047e5044 100644
--- a/seaweedfs-rdma-sidecar/pkg/seaweedfs/client.go
+++ b/seaweedfs-rdma-sidecar/pkg/seaweedfs/client.go
@@ -8,6 +8,7 @@ import (
"net/http"
"os"
"path/filepath"
+ "strings"
"time"
"seaweedfs-rdma-sidecar/pkg/rdma"
diff --git a/telemetry/proto/telemetry.pb.go b/telemetry/proto/telemetry.pb.go
index a400b8c375..8aa6ab6269 100644
--- a/telemetry/proto/telemetry.pb.go
+++ b/telemetry/proto/telemetry.pb.go
@@ -7,10 +7,11 @@
package proto
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/test/fuse_integration/framework.go b/test/fuse_integration/framework.go
index 2fe7ef343d..25fa2beb8d 100644
--- a/test/fuse_integration/framework.go
+++ b/test/fuse_integration/framework.go
@@ -3,6 +3,7 @@ package fuse_test
import (
"fmt"
"io/fs"
+ "net"
"os"
"os/exec"
"path/filepath"
diff --git a/test/fuse_integration/minimal_test.go b/test/fuse_integration/minimal_test.go
index 8d849fe770..13632df963 100644
--- a/test/fuse_integration/minimal_test.go
+++ b/test/fuse_integration/minimal_test.go
@@ -3,5 +3,5 @@ package fuse_test
import "testing"
func TestMinimal(t *testing.T) {
- t.Log("minimal test")
+ t.Log("minimal test")
}
diff --git a/test/kafka/integration/rebalancing_test.go b/test/kafka/integration/rebalancing_test.go
index f5ddeed569..fb962f888d 100644
--- a/test/kafka/integration/rebalancing_test.go
+++ b/test/kafka/integration/rebalancing_test.go
@@ -152,7 +152,7 @@ func testTwoConsumersRebalance(t *testing.T, addr, topicName, groupID string) {
// Wait for rebalancing to occur - both consumers should get new assignments
var rebalancedAssignment1, rebalancedAssignment2 []int32
-
+
// Consumer1 should get a rebalance assignment
select {
case partitions := <-handler1.assignments:
@@ -372,7 +372,7 @@ func testMultipleConsumersJoin(t *testing.T, addr, topicName, groupID string) {
t.Errorf("Partition %d assigned to multiple consumers", partition)
}
}
-
+
// Each consumer should get exactly 1 partition (4 partitions / 4 consumers)
if len(assignment) != 1 {
t.Errorf("Consumer%d should get exactly 1 partition, got %d", i, len(assignment))
@@ -408,7 +408,7 @@ func (h *RebalanceTestHandler) Setup(session sarama.ConsumerGroupSession) error
h.readyOnce.Do(func() {
close(h.ready)
})
-
+
// Send partition assignment
partitions := make([]int32, 0)
for topic, partitionList := range session.Claims() {
@@ -417,13 +417,13 @@ func (h *RebalanceTestHandler) Setup(session sarama.ConsumerGroupSession) error
partitions = append(partitions, partition)
}
}
-
+
select {
case h.assignments <- partitions:
default:
// Channel might be full, that's ok
}
-
+
return nil
}
diff --git a/test/kafka/integration/schema_end_to_end_test.go b/test/kafka/integration/schema_end_to_end_test.go
index 414056dd00..c0115e1e2d 100644
--- a/test/kafka/integration/schema_end_to_end_test.go
+++ b/test/kafka/integration/schema_end_to_end_test.go
@@ -86,7 +86,7 @@ func TestSchemaEndToEnd_AvroRoundTrip(t *testing.T) {
// Verify all fields
assert.Equal(t, int32(12345), decodedMap["id"])
assert.Equal(t, "Alice Johnson", decodedMap["name"])
-
+
// Verify union fields
emailUnion, ok := decodedMap["email"].(map[string]interface{})
require.True(t, ok, "Email should be a union")
@@ -126,7 +126,7 @@ func TestSchemaEndToEnd_ProtobufRoundTrip(t *testing.T) {
require.Equal(t, uint32(2), envelope.SchemaID, "Schema ID should match")
// Note: ParseConfluentEnvelope defaults to FormatAvro; format detection requires schema registry
require.Equal(t, schema.FormatAvro, envelope.Format, "Format defaults to Avro without schema registry lookup")
-
+
// For Protobuf with indexes, we need to use the specialized parser
protobufEnvelope, ok := schema.ParseConfluentProtobufEnvelopeWithIndexCount(confluentMsg, 1)
require.True(t, ok, "Message should be a valid Protobuf envelope")
@@ -269,7 +269,6 @@ func createMockSchemaRegistryForE2E(t *testing.T) *httptest.Server {
}))
}
-
func getUserAvroSchemaForE2E() string {
return `{
"type": "record",
diff --git a/test/kafka/kafka-client-loadtest/internal/consumer/consumer_stalling_test.go b/test/kafka/kafka-client-loadtest/internal/consumer/consumer_stalling_test.go
index 8e67f703e4..359a9e5470 100644
--- a/test/kafka/kafka-client-loadtest/internal/consumer/consumer_stalling_test.go
+++ b/test/kafka/kafka-client-loadtest/internal/consumer/consumer_stalling_test.go
@@ -5,7 +5,7 @@ import (
)
// TestConsumerStallingPattern is a REPRODUCER for the consumer stalling bug.
-//
+//
// This test simulates the exact pattern that causes consumers to stall:
// 1. Consumer reads messages in batches
// 2. Consumer commits offset after each batch
@@ -24,7 +24,7 @@ import (
// If the test PASSES, it means consumer successfully fetches all messages (bug fixed)
func TestConsumerStallingPattern(t *testing.T) {
t.Skip("REPRODUCER TEST: Requires running load test infrastructure. See comments for setup.")
-
+
// This test documents the exact stalling pattern:
// - Consumers consume messages 0-163, commit offset 163
// - Next iteration: fetch offset 164+
@@ -36,7 +36,7 @@ func TestConsumerStallingPattern(t *testing.T) {
// 2. Empty fetch doesn't mean "end of partition" (could be transient)
// 3. Consumer retries on empty fetch instead of giving up
// 4. Logging shows why fetch stopped
-
+
t.Logf("=== CONSUMER STALLING REPRODUCER ===")
t.Logf("")
t.Logf("Setup Steps:")
@@ -72,27 +72,27 @@ func TestConsumerStallingPattern(t *testing.T) {
// This is a UNIT reproducer that can run standalone
func TestOffsetPlusOneCalculation(t *testing.T) {
testCases := []struct {
- name string
- committedOffset int64
+ name string
+ committedOffset int64
expectedNextOffset int64
}{
{"Offset 0", 0, 1},
{"Offset 99", 99, 100},
- {"Offset 163", 163, 164}, // The exact stalling point!
+ {"Offset 163", 163, 164}, // The exact stalling point!
{"Offset 999", 999, 1000},
{"Large offset", 10000, 10001},
}
-
+
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
// This is the critical calculation
nextOffset := tc.committedOffset + 1
-
+
if nextOffset != tc.expectedNextOffset {
t.Fatalf("OFFSET MATH BUG: committed=%d, next=%d (expected %d)",
tc.committedOffset, nextOffset, tc.expectedNextOffset)
}
-
+
t.Logf("✓ offset %d → next fetch at %d", tc.committedOffset, nextOffset)
})
}
@@ -105,18 +105,18 @@ func TestEmptyFetchShouldNotStopConsumer(t *testing.T) {
// Scenario: Consumer committed offset 163, then fetches 164+
committedOffset := int64(163)
nextFetchOffset := committedOffset + 1
-
+
// First attempt: get empty (transient - data might not be available yet)
// WRONG behavior (bug): Consumer sees 0 bytes and stops
// wrongConsumerLogic := (firstFetchResult == 0) // gives up!
-
+
// CORRECT behavior: Consumer should retry
- correctConsumerLogic := true // continues retrying
-
+ correctConsumerLogic := true // continues retrying
+
if !correctConsumerLogic {
t.Fatalf("Consumer incorrectly gave up after empty fetch at offset %d", nextFetchOffset)
}
-
+
t.Logf("✓ Empty fetch doesn't stop consumer, continues retrying")
})
}
diff --git a/test/kafka/kafka-client-loadtest/internal/schema/pb/loadtest.pb.go b/test/kafka/kafka-client-loadtest/internal/schema/pb/loadtest.pb.go
index 3ed58aa9e8..f70414f7b8 100644
--- a/test/kafka/kafka-client-loadtest/internal/schema/pb/loadtest.pb.go
+++ b/test/kafka/kafka-client-loadtest/internal/schema/pb/loadtest.pb.go
@@ -7,11 +7,12 @@
package pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/test/kafka/loadtest/resume_million_test.go b/test/kafka/loadtest/resume_million_test.go
index 48656c154d..699236d5c4 100644
--- a/test/kafka/loadtest/resume_million_test.go
+++ b/test/kafka/loadtest/resume_million_test.go
@@ -205,4 +205,3 @@ func TestResumeMillionRecords_Fixed(t *testing.T) {
glog.Infof("🏆 MILLION RECORD KAFKA INTEGRATION TEST COMPLETED SUCCESSFULLY!")
}
-
diff --git a/test/kafka/unit/gateway_test.go b/test/kafka/unit/gateway_test.go
index 7f6d076e06..e6d4c9cfcc 100644
--- a/test/kafka/unit/gateway_test.go
+++ b/test/kafka/unit/gateway_test.go
@@ -16,7 +16,7 @@ func TestGatewayBasicFunctionality(t *testing.T) {
defer gateway.CleanupAndClose()
addr := gateway.StartAndWait()
-
+
// Give the gateway a bit more time to be fully ready
time.Sleep(200 * time.Millisecond)
@@ -32,17 +32,17 @@ func TestGatewayBasicFunctionality(t *testing.T) {
func testGatewayAcceptsConnections(t *testing.T, addr string) {
// Test basic TCP connection to gateway
t.Logf("Testing connection to gateway at %s", addr)
-
+
conn, err := net.DialTimeout("tcp", addr, 5*time.Second)
if err != nil {
t.Fatalf("Failed to connect to gateway: %v", err)
}
defer conn.Close()
-
+
// Test that we can establish a connection and the gateway is listening
// We don't need to send a full Kafka request for this basic test
t.Logf("Successfully connected to gateway at %s", addr)
-
+
// Optional: Test that we can write some data without error
testData := []byte("test")
conn.SetWriteDeadline(time.Now().Add(1 * time.Second))
@@ -57,19 +57,19 @@ func testGatewayRefusesAfterClose(t *testing.T, gateway *testutil.GatewayTestSer
// Get the address from the gateway's listener
host, port := gateway.GetListenerAddr()
addr := fmt.Sprintf("%s:%d", host, port)
-
+
// Close the gateway
gateway.CleanupAndClose()
-
+
t.Log("Testing that gateway refuses connections after close")
-
+
// Attempt to connect - should fail
conn, err := net.DialTimeout("tcp", addr, 2*time.Second)
if err == nil {
conn.Close()
t.Fatal("Expected connection to fail after gateway close, but it succeeded")
}
-
+
// Verify it's a connection refused error
if !strings.Contains(err.Error(), "connection refused") && !strings.Contains(err.Error(), "connect: connection refused") {
t.Logf("Connection failed as expected with error: %v", err)
diff --git a/test/s3/etag/s3_etag_test.go b/test/s3/etag/s3_etag_test.go
index 1b87eaf129..9b1e948b09 100644
--- a/test/s3/etag/s3_etag_test.go
+++ b/test/s3/etag/s3_etag_test.go
@@ -63,11 +63,11 @@ const (
autoChunkSize = 8 * 1024 * 1024
// Test sizes
- smallFileSize = 1 * 1024 // 1KB - single chunk
- mediumFileSize = 256 * 1024 // 256KB - single chunk (at threshold)
- largeFileSize = 10 * 1024 * 1024 // 10MB - triggers auto-chunking (2 chunks)
- xlFileSize = 25 * 1024 * 1024 // 25MB - triggers auto-chunking (4 chunks)
- multipartSize = 5 * 1024 * 1024 // 5MB per part for multipart uploads
+ smallFileSize = 1 * 1024 // 1KB - single chunk
+ mediumFileSize = 256 * 1024 // 256KB - single chunk (at threshold)
+ largeFileSize = 10 * 1024 * 1024 // 10MB - triggers auto-chunking (2 chunks)
+ xlFileSize = 25 * 1024 * 1024 // 25MB - triggers auto-chunking (4 chunks)
+ multipartSize = 5 * 1024 * 1024 // 5MB per part for multipart uploads
)
// ETag format patterns
@@ -540,4 +540,3 @@ func TestMultipleLargeFileUploads(t *testing.T) {
assert.NoError(t, err, "File %d ETag should be valid hex", i)
}
}
-
diff --git a/test/s3/iam/s3_iam_integration_test.go b/test/s3/iam/s3_iam_integration_test.go
index ecf5f0ebab..478e330cd3 100644
--- a/test/s3/iam/s3_iam_integration_test.go
+++ b/test/s3/iam/s3_iam_integration_test.go
@@ -443,7 +443,7 @@ func TestS3IAMBucketPolicyIntegration(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, testObjectData, string(data))
result.Body.Close()
-
+
// Clean up bucket policy after this test
_, err = adminClient.DeleteBucketPolicy(&s3.DeleteBucketPolicyInput{
Bucket: aws.String(bucketName),
@@ -481,7 +481,7 @@ func TestS3IAMBucketPolicyIntegration(t *testing.T) {
assert.Contains(t, *policyResult.Policy, "Deny")
// NOTE: Enforcement test is commented out due to known architectural limitation:
- //
+ //
// KNOWN LIMITATION: DeleteObject uses the coarse-grained ACTION_WRITE constant,
// which convertActionToS3Format maps to "s3:PutObject" (not "s3:DeleteObject").
// This means the policy engine evaluates the deny policy against "s3:PutObject",
@@ -499,7 +499,7 @@ func TestS3IAMBucketPolicyIntegration(t *testing.T) {
// awsErr, ok := err.(awserr.Error)
// require.True(t, ok, "Error should be an awserr.Error")
// assert.Equal(t, "AccessDenied", awsErr.Code(), "Expected AccessDenied error code")
-
+
// Clean up bucket policy after this test
_, err = adminClient.DeleteBucketPolicy(&s3.DeleteBucketPolicyInput{
Bucket: aws.String(bucketName),
diff --git a/test/s3/s3client/s3client.go b/test/s3/s3client/s3client.go
index e789c57c6b..0179ad27c8 100644
--- a/test/s3/s3client/s3client.go
+++ b/test/s3/s3client/s3client.go
@@ -2,12 +2,13 @@ package main
import (
"context"
+ "time"
+
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"
- "time"
)
func main() {
diff --git a/test/s3/sse/github_7562_copy_test.go b/test/s3/sse/github_7562_copy_test.go
index 5831c0b80c..088ae93adc 100644
--- a/test/s3/sse/github_7562_copy_test.go
+++ b/test/s3/sse/github_7562_copy_test.go
@@ -502,4 +502,3 @@ func TestGitHub7562LargeFile(t *testing.T) {
t.Log("Large file test passed!")
}
-
diff --git a/test/s3/versioning/s3_versioning_multipart_test.go b/test/s3/versioning/s3_versioning_multipart_test.go
index 8fb51380c4..23520c806e 100644
--- a/test/s3/versioning/s3_versioning_multipart_test.go
+++ b/test/s3/versioning/s3_versioning_multipart_test.go
@@ -518,4 +518,3 @@ func TestMultipartUploadDeleteMarkerListBehavior(t *testing.T) {
t.Logf("Object restored after delete marker removal, ETag=%s", multipartETag)
}
-
diff --git a/test/s3/versioning/s3_versioning_pagination_stress_test.go b/test/s3/versioning/s3_versioning_pagination_stress_test.go
index acd716f15e..ae18cac65a 100644
--- a/test/s3/versioning/s3_versioning_pagination_stress_test.go
+++ b/test/s3/versioning/s3_versioning_pagination_stress_test.go
@@ -319,4 +319,3 @@ func listAllVersions(t *testing.T, client *s3.Client, bucketName, objectKey stri
t.Logf("Total: %d versions in %d pages", len(allVersions), pageCount)
return allVersions
}
-
diff --git a/test/sftp/basic_test.go b/test/sftp/basic_test.go
index e5ffe90d10..bad875208b 100644
--- a/test/sftp/basic_test.go
+++ b/test/sftp/basic_test.go
@@ -540,11 +540,11 @@ func TestPathEdgeCases(t *testing.T) {
// Therefore, we cannot trigger the server-side path traversal block with this client.
// Instead, we verify that the file is created successfully within the jail (contained).
// The server-side protection logic is verified in unit tests (sftpd/sftp_server_test.go).
-
+
file, err := sftpClient.Create(traversalPath)
require.NoError(t, err, "creation should succeed because client sanitizes path")
file.Close()
-
+
// Clean up
err = sftpClient.Remove(traversalPath)
require.NoError(t, err)
@@ -649,4 +649,3 @@ func TestFileContent(t *testing.T) {
sftpClient.Remove(filename)
})
}
-
diff --git a/test/sftp/framework.go b/test/sftp/framework.go
index ea4ac3e359..73b122e301 100644
--- a/test/sftp/framework.go
+++ b/test/sftp/framework.go
@@ -420,4 +420,3 @@ func findTestDataPath() string {
return "./testdata"
}
-
diff --git a/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go b/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go
index 0544e5f2bf..3f15c30adb 100644
--- a/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go
+++ b/unmaintained/load_test/load_test_meta_tail/load_test_meta_tail.go
@@ -4,6 +4,10 @@ import (
"context"
"flag"
"fmt"
+ "strconv"
+ "strings"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@@ -11,9 +15,6 @@ import (
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
- "strconv"
- "strings"
- "time"
)
var (
diff --git a/unmaintained/repeated_vacuum/repeated_vacuum.go b/unmaintained/repeated_vacuum/repeated_vacuum.go
index 0a796a92f9..983db92677 100644
--- a/unmaintained/repeated_vacuum/repeated_vacuum.go
+++ b/unmaintained/repeated_vacuum/repeated_vacuum.go
@@ -4,17 +4,16 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"log"
"math/rand"
"time"
- "google.golang.org/grpc"
-
"github.com/seaweedfs/seaweedfs/weed/operation"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
+ "google.golang.org/grpc"
)
var (
diff --git a/unmaintained/s3/presigned_put/presigned_put.go b/unmaintained/s3/presigned_put/presigned_put.go
index 46e4cbf064..f4c7ad6e8b 100644
--- a/unmaintained/s3/presigned_put/presigned_put.go
+++ b/unmaintained/s3/presigned_put/presigned_put.go
@@ -4,13 +4,14 @@ import (
"crypto/md5"
"encoding/base64"
"fmt"
+ "net/http"
+ "strings"
+ "time"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
- "net/http"
- "strings"
- "time"
)
// Downloads an item from an S3 Bucket in the region configured in the shared config
diff --git a/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go b/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
index a98da1d01b..0cc06c03ae 100644
--- a/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
+++ b/unmaintained/stress_filer_upload/bench_filer_upload/bench_filer_upload.go
@@ -4,7 +4,6 @@ import (
"bytes"
"flag"
"fmt"
- util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"io"
"log"
"math/rand"
@@ -14,6 +13,8 @@ import (
"strings"
"sync"
"time"
+
+ util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
var (
diff --git a/unmaintained/stress_filer_upload/stress_filer_upload_actual/stress_filer_upload.go b/unmaintained/stress_filer_upload/stress_filer_upload_actual/stress_filer_upload.go
index 1c3befe3d2..d8b306b52c 100644
--- a/unmaintained/stress_filer_upload/stress_filer_upload_actual/stress_filer_upload.go
+++ b/unmaintained/stress_filer_upload/stress_filer_upload_actual/stress_filer_upload.go
@@ -4,7 +4,6 @@ import (
"bytes"
"flag"
"fmt"
- util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"io"
"log"
"math/rand"
@@ -15,6 +14,8 @@ import (
"strings"
"sync"
"time"
+
+ util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
var (
diff --git a/unmaintained/volume_tailer/volume_tailer.go b/unmaintained/volume_tailer/volume_tailer.go
index 03f728ad06..48f9d5e156 100644
--- a/unmaintained/volume_tailer/volume_tailer.go
+++ b/unmaintained/volume_tailer/volume_tailer.go
@@ -3,11 +3,11 @@ package main
import (
"context"
"flag"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"log"
"time"
"github.com/seaweedfs/seaweedfs/weed/operation"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
util2 "github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/cluster/cluster_test.go b/weed/cluster/cluster_test.go
index db8384d889..d7a0047e29 100644
--- a/weed/cluster/cluster_test.go
+++ b/weed/cluster/cluster_test.go
@@ -1,10 +1,11 @@
package cluster
import (
- "github.com/seaweedfs/seaweedfs/weed/pb"
"strconv"
"sync"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb"
)
func TestConcurrentAddRemoveNodes(t *testing.T) {
diff --git a/weed/cluster/group_members.go b/weed/cluster/group_members.go
index 79bd787905..5c0c09977c 100644
--- a/weed/cluster/group_members.go
+++ b/weed/cluster/group_members.go
@@ -1,8 +1,9 @@
package cluster
import (
- "github.com/seaweedfs/seaweedfs/weed/pb"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb"
)
type GroupMembers struct {
diff --git a/weed/cluster/lock_manager/distributed_lock_manager.go b/weed/cluster/lock_manager/distributed_lock_manager.go
index 7de78410f6..31f8b979fb 100644
--- a/weed/cluster/lock_manager/distributed_lock_manager.go
+++ b/weed/cluster/lock_manager/distributed_lock_manager.go
@@ -2,9 +2,10 @@ package lock_manager
import (
"fmt"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
- "time"
)
const RenewInterval = time.Second * 3
diff --git a/weed/cluster/lock_manager/lock_manager.go b/weed/cluster/lock_manager/lock_manager.go
index ebc9dfeaac..4f7c6f9c63 100644
--- a/weed/cluster/lock_manager/lock_manager.go
+++ b/weed/cluster/lock_manager/lock_manager.go
@@ -2,10 +2,11 @@ package lock_manager
import (
"fmt"
- "github.com/google/uuid"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"sync"
"time"
+
+ "github.com/google/uuid"
+ "github.com/seaweedfs/seaweedfs/weed/glog"
)
var LockErrorNonEmptyTokenOnNewLock = fmt.Errorf("lock: non-empty token on a new lock")
diff --git a/weed/command/autocomplete.go b/weed/command/autocomplete.go
index 6a74311dc1..4422e3b2d1 100644
--- a/weed/command/autocomplete.go
+++ b/weed/command/autocomplete.go
@@ -2,12 +2,13 @@ package command
import (
"fmt"
- "github.com/posener/complete"
- completeinstall "github.com/posener/complete/cmd/install"
- flag "github.com/seaweedfs/seaweedfs/weed/util/fla9"
"os"
"path/filepath"
"runtime"
+
+ "github.com/posener/complete"
+ completeinstall "github.com/posener/complete/cmd/install"
+ flag "github.com/seaweedfs/seaweedfs/weed/util/fla9"
)
func AutocompleteMain(commands []*Command) bool {
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index c9e6f6766f..91ec1cfb01 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -4,8 +4,6 @@ import (
"bufio"
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"io"
"math"
"math/rand"
@@ -16,14 +14,15 @@ import (
"sync"
"time"
- "google.golang.org/grpc"
-
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
+ "google.golang.org/grpc"
)
type BenchmarkOptions struct {
diff --git a/weed/command/filer_meta_tail.go b/weed/command/filer_meta_tail.go
index d7a169535d..94481c28dc 100644
--- a/weed/command/filer_meta_tail.go
+++ b/weed/command/filer_meta_tail.go
@@ -2,13 +2,13 @@ package command
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"os"
"path/filepath"
"strings"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/filer"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/command/filer_meta_tail_elastic.go b/weed/command/filer_meta_tail_elastic.go
index a72f889023..6e18638dd6 100644
--- a/weed/command/filer_meta_tail_elastic.go
+++ b/weed/command/filer_meta_tail_elastic.go
@@ -5,11 +5,12 @@ package command
import (
"context"
+ "strings"
+
jsoniter "github.com/json-iterator/go"
elastic "github.com/olivere/elastic/v7"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
- "strings"
)
type EsDocument struct {
diff --git a/weed/command/filer_remote_gateway.go b/weed/command/filer_remote_gateway.go
index 3e52e8d3ff..2156c1655a 100644
--- a/weed/command/filer_remote_gateway.go
+++ b/weed/command/filer_remote_gateway.go
@@ -3,6 +3,9 @@ package command
import (
"context"
"fmt"
+ "os"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@@ -11,8 +14,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/grpc"
- "os"
- "time"
)
type RemoteGatewayOptions struct {
diff --git a/weed/command/filer_remote_gateway_buckets.go b/weed/command/filer_remote_gateway_buckets.go
index 5c7e0ae214..53fb50da71 100644
--- a/weed/command/filer_remote_gateway_buckets.go
+++ b/weed/command/filer_remote_gateway_buckets.go
@@ -3,6 +3,12 @@ package command
import (
"context"
"fmt"
+ "math"
+ "math/rand"
+ "path/filepath"
+ "strings"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
@@ -12,11 +18,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/replication/source"
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/protobuf/proto"
- "math"
- "math/rand"
- "path/filepath"
- "strings"
- "time"
)
func (option *RemoteGatewayOptions) followBucketUpdatesAndUploadToRemote(filerSource *source.FilerSource) error {
diff --git a/weed/command/filer_remote_sync.go b/weed/command/filer_remote_sync.go
index 77dd951344..9e96f6d069 100644
--- a/weed/command/filer_remote_sync.go
+++ b/weed/command/filer_remote_sync.go
@@ -2,6 +2,8 @@ package command
import (
"fmt"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@@ -9,7 +11,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/grpc"
- "time"
)
type RemoteSyncOptions struct {
diff --git a/weed/command/filer_sync_jobs.go b/weed/command/filer_sync_jobs.go
index d49031b98e..1c75eb0e18 100644
--- a/weed/command/filer_sync_jobs.go
+++ b/weed/command/filer_sync_jobs.go
@@ -1,12 +1,13 @@
package command
import (
+ "sync"
+ "sync/atomic"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
- "sync"
- "sync/atomic"
)
type MetadataProcessor struct {
diff --git a/weed/command/mini.go b/weed/command/mini.go
index f246a9d88d..815eba72a6 100644
--- a/weed/command/mini.go
+++ b/weed/command/mini.go
@@ -1105,7 +1105,6 @@ func startMiniWorker() {
glog.Infof("Maintenance worker %s started successfully", workerInstance.ID())
}
-
const credentialsInstructionTemplate = `
To create S3 credentials, you have two options:
@@ -1166,10 +1165,10 @@ func printWelcomeMessage() {
fmt.Fprintf(&sb, credentialsInstructionTemplate, *miniIp, *miniAdminOptions.port)
} else {
sb.WriteString("\n To create S3 credentials, use environment variables:\n\n")
- sb.WriteString(" export AWS_ACCESS_KEY_ID=your-access-key\\n")
- sb.WriteString(" export AWS_SECRET_ACCESS_KEY=your-secret-key\\n")
- sb.WriteString(" weed mini -dir=/data\\n")
- sb.WriteString(" This will create initial credentials for the 'mini' user.\\n")
+ sb.WriteString(" export AWS_ACCESS_KEY_ID=your-access-key\\n")
+ sb.WriteString(" export AWS_SECRET_ACCESS_KEY=your-secret-key\\n")
+ sb.WriteString(" weed mini -dir=/data\\n")
+ sb.WriteString(" This will create initial credentials for the 'mini' user.\\n")
}
fmt.Print(sb.String())
diff --git a/weed/command/mount_linux.go b/weed/command/mount_linux.go
index 1d1727519c..2d5f11c26c 100644
--- a/weed/command/mount_linux.go
+++ b/weed/command/mount_linux.go
@@ -3,10 +3,11 @@ package command
import (
"bufio"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"io"
"os"
"strings"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
)
const (
diff --git a/weed/command/sftp.go b/weed/command/sftp.go
index 58cc5b14a6..07b5b00761 100644
--- a/weed/command/sftp.go
+++ b/weed/command/sftp.go
@@ -3,7 +3,6 @@ package command
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"net"
"os"
"runtime"
@@ -17,6 +16,7 @@ import (
stats_collect "github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/grace"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
var (
diff --git a/weed/command/shell.go b/weed/command/shell.go
index 1e921411b9..962fe26ee3 100644
--- a/weed/command/shell.go
+++ b/weed/command/shell.go
@@ -2,6 +2,7 @@ package command
import (
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/security"
diff --git a/weed/command/update.go b/weed/command/update.go
index cc464dd286..57953c5651 100644
--- a/weed/command/update.go
+++ b/weed/command/update.go
@@ -10,7 +10,6 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
- swv "github.com/seaweedfs/seaweedfs/weed/util/version"
"io"
"net/http"
"os"
@@ -22,6 +21,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
+ swv "github.com/seaweedfs/seaweedfs/weed/util/version"
"golang.org/x/net/context/ctxhttp"
)
diff --git a/weed/command/version.go b/weed/command/version.go
index fdde081ad5..d62607f0ca 100644
--- a/weed/command/version.go
+++ b/weed/command/version.go
@@ -2,8 +2,9 @@ package command
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"runtime"
+
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
var cmdVersion = &Command{
diff --git a/weed/credential/filer_etc/filer_etc_identity.go b/weed/credential/filer_etc/filer_etc_identity.go
index 71de39b4d0..5648167e53 100644
--- a/weed/credential/filer_etc/filer_etc_identity.go
+++ b/weed/credential/filer_etc/filer_etc_identity.go
@@ -15,7 +15,7 @@ import (
func (store *FilerEtcStore) LoadConfiguration(ctx context.Context) (*iam_pb.S3ApiConfiguration, error) {
s3cfg := &iam_pb.S3ApiConfiguration{}
- glog.V(1).Infof("Loading IAM configuration from %s/%s (using current active filer)",
+ glog.V(1).Infof("Loading IAM configuration from %s/%s (using current active filer)",
filer.IamConfigDirectory, filer.IamIdentityFile)
err := store.withFilerClient(func(client filer_pb.SeaweedFilerClient) error {
@@ -25,31 +25,31 @@ func (store *FilerEtcStore) LoadConfiguration(ctx context.Context) (*iam_pb.S3Ap
content, err := filer.ReadInsideFiler(client, filer.IamConfigDirectory, filer.IamIdentityFile)
if err != nil {
if err == filer_pb.ErrNotFound {
- glog.V(1).Infof("IAM identity file not found at %s/%s, no credentials loaded",
+ glog.V(1).Infof("IAM identity file not found at %s/%s, no credentials loaded",
filer.IamConfigDirectory, filer.IamIdentityFile)
return nil
}
- glog.Errorf("Failed to read IAM identity file from %s/%s: %v",
+ glog.Errorf("Failed to read IAM identity file from %s/%s: %v",
filer.IamConfigDirectory, filer.IamIdentityFile, err)
return err
}
-
+
if len(content) == 0 {
- glog.V(1).Infof("IAM identity file at %s/%s is empty",
+ glog.V(1).Infof("IAM identity file at %s/%s is empty",
filer.IamConfigDirectory, filer.IamIdentityFile)
return nil
}
-
- glog.V(2).Infof("Read %d bytes from %s/%s",
+
+ glog.V(2).Infof("Read %d bytes from %s/%s",
len(content), filer.IamConfigDirectory, filer.IamIdentityFile)
-
+
if err := filer.ParseS3ConfigurationFromBytes(content, s3cfg); err != nil {
- glog.Errorf("Failed to parse IAM configuration from %s/%s: %v",
+ glog.Errorf("Failed to parse IAM configuration from %s/%s: %v",
filer.IamConfigDirectory, filer.IamIdentityFile, err)
return err
}
-
- glog.V(1).Infof("Successfully parsed IAM configuration with %d identities and %d accounts",
+
+ glog.V(1).Infof("Successfully parsed IAM configuration with %d identities and %d accounts",
len(s3cfg.Identities), len(s3cfg.Accounts))
return nil
})
@@ -63,7 +63,7 @@ func (store *FilerEtcStore) LoadConfiguration(ctx context.Context) (*iam_pb.S3Ap
for _, identity := range s3cfg.Identities {
credCount := len(identity.Credentials)
actionCount := len(identity.Actions)
- glog.V(2).Infof(" Identity: %s (credentials: %d, actions: %d)",
+ glog.V(2).Infof(" Identity: %s (credentials: %d, actions: %d)",
identity.Name, credCount, actionCount)
for _, cred := range identity.Credentials {
glog.V(3).Infof(" Access Key: %s", cred.AccessKey)
diff --git a/weed/credential/filer_etc/filer_etc_policy.go b/weed/credential/filer_etc/filer_etc_policy.go
index 99931bae8e..96ef0cca79 100644
--- a/weed/credential/filer_etc/filer_etc_policy.go
+++ b/weed/credential/filer_etc/filer_etc_policy.go
@@ -24,14 +24,14 @@ func (store *FilerEtcStore) GetPolicies(ctx context.Context) (map[string]policy_
store.mu.RLock()
configured := store.filerAddressFunc != nil
store.mu.RUnlock()
-
+
if !configured {
glog.V(1).Infof("Filer client not configured for policy retrieval, returning empty policies")
// Return empty policies if filer client is not configured
return policiesCollection.Policies, nil
}
- glog.V(2).Infof("Loading IAM policies from %s/%s (using current active filer)",
+ glog.V(2).Infof("Loading IAM policies from %s/%s (using current active filer)",
filer.IamConfigDirectory, filer.IamPoliciesFile)
err := store.withFilerClient(func(client filer_pb.SeaweedFilerClient) error {
@@ -41,27 +41,27 @@ func (store *FilerEtcStore) GetPolicies(ctx context.Context) (map[string]policy_
content, err := filer.ReadInsideFiler(client, filer.IamConfigDirectory, filer.IamPoliciesFile)
if err != nil {
if err == filer_pb.ErrNotFound {
- glog.V(1).Infof("Policies file not found at %s/%s, returning empty policies",
+ glog.V(1).Infof("Policies file not found at %s/%s, returning empty policies",
filer.IamConfigDirectory, filer.IamPoliciesFile)
// If file doesn't exist, return empty collection
return nil
}
- glog.Errorf("Failed to read IAM policies file from %s/%s: %v",
+ glog.Errorf("Failed to read IAM policies file from %s/%s: %v",
filer.IamConfigDirectory, filer.IamPoliciesFile, err)
return err
}
if len(content) == 0 {
- glog.V(2).Infof("IAM policies file at %s/%s is empty",
+ glog.V(2).Infof("IAM policies file at %s/%s is empty",
filer.IamConfigDirectory, filer.IamPoliciesFile)
return nil
}
- glog.V(2).Infof("Read %d bytes from %s/%s",
+ glog.V(2).Infof("Read %d bytes from %s/%s",
len(content), filer.IamConfigDirectory, filer.IamPoliciesFile)
if err := json.Unmarshal(content, policiesCollection); err != nil {
- glog.Errorf("Failed to parse IAM policies from %s/%s: %v",
+ glog.Errorf("Failed to parse IAM policies from %s/%s: %v",
filer.IamConfigDirectory, filer.IamPoliciesFile, err)
return err
}
diff --git a/weed/credential/filer_etc/filer_etc_store.go b/weed/credential/filer_etc/filer_etc_store.go
index e174b5ef48..a9f7cc1e78 100644
--- a/weed/credential/filer_etc/filer_etc_store.go
+++ b/weed/credential/filer_etc/filer_etc_store.go
@@ -64,7 +64,7 @@ func (store *FilerEtcStore) withFilerClient(fn func(client filer_pb.SeaweedFiler
filerAddress := store.filerAddressFunc()
dialOption := store.grpcDialOption
store.mu.RUnlock()
-
+
if filerAddress == "" {
return fmt.Errorf("filer_etc: no filer discovered yet - please ensure a filer is running and accessible")
}
diff --git a/weed/filer/abstract_sql/abstract_sql_store_kv.go b/weed/filer/abstract_sql/abstract_sql_store_kv.go
index ad9e6ab415..41a7196a9b 100644
--- a/weed/filer/abstract_sql/abstract_sql_store_kv.go
+++ b/weed/filer/abstract_sql/abstract_sql_store_kv.go
@@ -5,10 +5,11 @@ import (
"database/sql"
"encoding/base64"
"fmt"
+ "strings"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util"
- "strings"
)
func (store *AbstractSqlStore) KvPut(ctx context.Context, key []byte, value []byte) (err error) {
diff --git a/weed/filer/arangodb/arangodb_store_bucket.go b/weed/filer/arangodb/arangodb_store_bucket.go
index 44aeeadeaf..b3a4e71d04 100644
--- a/weed/filer/arangodb/arangodb_store_bucket.go
+++ b/weed/filer/arangodb/arangodb_store_bucket.go
@@ -2,11 +2,10 @@ package arangodb
import (
"context"
- "github.com/arangodb/go-driver"
"time"
+ "github.com/arangodb/go-driver"
"github.com/seaweedfs/seaweedfs/weed/filer"
-
"github.com/seaweedfs/seaweedfs/weed/glog"
)
diff --git a/weed/filer/cassandra/cassandra_store_kv.go b/weed/filer/cassandra/cassandra_store_kv.go
index eea59ffbd4..49dc542dec 100644
--- a/weed/filer/cassandra/cassandra_store_kv.go
+++ b/weed/filer/cassandra/cassandra_store_kv.go
@@ -4,6 +4,7 @@ import (
"context"
"encoding/base64"
"fmt"
+
"github.com/gocql/gocql"
"github.com/seaweedfs/seaweedfs/weed/filer"
)
diff --git a/weed/filer/cassandra2/cassandra_store_kv.go b/weed/filer/cassandra2/cassandra_store_kv.go
index e11193b8b0..3c1db7a45e 100644
--- a/weed/filer/cassandra2/cassandra_store_kv.go
+++ b/weed/filer/cassandra2/cassandra_store_kv.go
@@ -4,6 +4,7 @@ import (
"context"
"encoding/base64"
"fmt"
+
"github.com/gocql/gocql"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/filer/configuration.go b/weed/filer/configuration.go
index db4af15598..550fcb4345 100644
--- a/weed/filer/configuration.go
+++ b/weed/filer/configuration.go
@@ -1,11 +1,12 @@
package filer
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
- "github.com/seaweedfs/seaweedfs/weed/util"
"os"
"reflect"
"strings"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
var (
diff --git a/weed/filer/empty_folder_cleanup/cleanup_queue.go b/weed/filer/empty_folder_cleanup/cleanup_queue.go
index aabcaeaf93..b2f66a8352 100644
--- a/weed/filer/empty_folder_cleanup/cleanup_queue.go
+++ b/weed/filer/empty_folder_cleanup/cleanup_queue.go
@@ -203,6 +203,3 @@ func (q *CleanupQueue) OldestAge() time.Duration {
item := front.Value.(*queueItem)
return time.Since(item.queueTime)
}
-
-
-
diff --git a/weed/filer/empty_folder_cleanup/cleanup_queue_test.go b/weed/filer/empty_folder_cleanup/cleanup_queue_test.go
index 1295fa0d4f..0e26495ddf 100644
--- a/weed/filer/empty_folder_cleanup/cleanup_queue_test.go
+++ b/weed/filer/empty_folder_cleanup/cleanup_queue_test.go
@@ -367,6 +367,3 @@ func TestCleanupQueue_Concurrent(t *testing.T) {
// Just verify no panic occurred and queue is in consistent state
_ = q.Len()
}
-
-
-
diff --git a/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go b/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go
index 70856aaf1a..f7d7b88641 100644
--- a/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go
+++ b/weed/filer/empty_folder_cleanup/empty_folder_cleaner.go
@@ -433,4 +433,3 @@ func (efc *EmptyFolderCleaner) GetCachedFolderCount(folder string) (int, bool) {
}
return 0, false
}
-
diff --git a/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go b/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go
index fbc05ccf88..1c62a5dd13 100644
--- a/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go
+++ b/weed/filer/empty_folder_cleanup/empty_folder_cleaner_test.go
@@ -566,4 +566,3 @@ func TestEmptyFolderCleaner_queueFIFOOrder(t *testing.T) {
cleaner.Stop()
}
-
diff --git a/weed/filer/entry.go b/weed/filer/entry.go
index 25fc26febe..237ddc964e 100644
--- a/weed/filer/entry.go
+++ b/weed/filer/entry.go
@@ -1,11 +1,11 @@
package filer
import (
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"os"
"time"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/filer/etcd/etcd_store_kv.go b/weed/filer/etcd/etcd_store_kv.go
index e2536ba1c2..8a9ed68543 100644
--- a/weed/filer/etcd/etcd_store_kv.go
+++ b/weed/filer/etcd/etcd_store_kv.go
@@ -3,6 +3,7 @@ package etcd
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
)
diff --git a/weed/filer/etcd/etcd_store_test.go b/weed/filer/etcd/etcd_store_test.go
index 6abb74697c..127e10cb01 100644
--- a/weed/filer/etcd/etcd_store_test.go
+++ b/weed/filer/etcd/etcd_store_test.go
@@ -1,8 +1,9 @@
package etcd
import (
- "github.com/seaweedfs/seaweedfs/weed/filer/store_test"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/filer/store_test"
)
func TestStore(t *testing.T) {
diff --git a/weed/filer/filechunk_section_test.go b/weed/filer/filechunk_section_test.go
index 7b76c8456d..97ead8ead9 100644
--- a/weed/filer/filechunk_section_test.go
+++ b/weed/filer/filechunk_section_test.go
@@ -1,8 +1,9 @@
package filer
import (
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
func Test_removeGarbageChunks(t *testing.T) {
diff --git a/weed/filer/filechunks.go b/weed/filer/filechunks.go
index 43261a9709..8a82470c8d 100644
--- a/weed/filer/filechunks.go
+++ b/weed/filer/filechunks.go
@@ -4,11 +4,11 @@ import (
"bytes"
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/wdclient"
"math"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
+ "github.com/seaweedfs/seaweedfs/weed/wdclient"
)
func TotalSize(chunks []*filer_pb.FileChunk) (size uint64) {
diff --git a/weed/filer/filechunks2_test.go b/weed/filer/filechunks2_test.go
index b735b8a276..9c8a916e6a 100644
--- a/weed/filer/filechunks2_test.go
+++ b/weed/filer/filechunks2_test.go
@@ -2,13 +2,13 @@ package filer
import (
"context"
- "github.com/stretchr/testify/assert"
"log"
"slices"
"testing"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
+ "github.com/stretchr/testify/assert"
)
func TestDoMinusChunks(t *testing.T) {
diff --git a/weed/filer/filechunks_read.go b/weed/filer/filechunks_read.go
index 756e18b343..59a00e6ff9 100644
--- a/weed/filer/filechunks_read.go
+++ b/weed/filer/filechunks_read.go
@@ -2,8 +2,9 @@ package filer
import (
"container/list"
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"slices"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
func readResolvedChunks(chunks []*filer_pb.FileChunk, startOffset int64, stopOffset int64) (visibles *IntervalList[*VisibleInterval]) {
diff --git a/weed/filer/filechunks_read_test.go b/weed/filer/filechunks_read_test.go
index c66a874bc9..5bfd34cfda 100644
--- a/weed/filer/filechunks_read_test.go
+++ b/weed/filer/filechunks_read_test.go
@@ -2,10 +2,11 @@ package filer
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"math"
"math/rand"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
func TestReadResolvedChunks(t *testing.T) {
diff --git a/weed/filer/filerstore_wrapper.go b/weed/filer/filerstore_wrapper.go
index 5114955c71..485f3c9ea5 100644
--- a/weed/filer/filerstore_wrapper.go
+++ b/weed/filer/filerstore_wrapper.go
@@ -32,9 +32,9 @@ type VirtualFilerStore interface {
}
type FilerStoreWrapper struct {
- defaultStore FilerStore
- pathToStore ptrie.Trie[string]
- storeIdToStore map[string]FilerStore
+ defaultStore FilerStore
+ pathToStore ptrie.Trie[string]
+ storeIdToStore map[string]FilerStore
hasPathSpecificStore bool // fast check to skip MatchPrefix when no path-specific stores
}
diff --git a/weed/filer/hbase/hbase_store_kv.go b/weed/filer/hbase/hbase_store_kv.go
index 0939b87527..e270a1a044 100644
--- a/weed/filer/hbase/hbase_store_kv.go
+++ b/weed/filer/hbase/hbase_store_kv.go
@@ -2,9 +2,10 @@ package hbase
import (
"context"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/tsuna/gohbase/hrpc"
- "time"
)
const (
diff --git a/weed/filer/interval_list_test.go b/weed/filer/interval_list_test.go
index dea510fedb..304222c016 100644
--- a/weed/filer/interval_list_test.go
+++ b/weed/filer/interval_list_test.go
@@ -2,8 +2,9 @@ package filer
import (
"fmt"
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
type IntervalInt int
diff --git a/weed/filer/leveldb/leveldb_store_kv.go b/weed/filer/leveldb/leveldb_store_kv.go
index c961b5e91a..de189607dc 100644
--- a/weed/filer/leveldb/leveldb_store_kv.go
+++ b/weed/filer/leveldb/leveldb_store_kv.go
@@ -3,6 +3,7 @@ package leveldb
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/syndtr/goleveldb/leveldb"
)
diff --git a/weed/filer/leveldb/leveldb_store_test.go b/weed/filer/leveldb/leveldb_store_test.go
index 5676b16174..a491d969b0 100644
--- a/weed/filer/leveldb/leveldb_store_test.go
+++ b/weed/filer/leveldb/leveldb_store_test.go
@@ -3,12 +3,12 @@ package leveldb
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"os"
"testing"
"time"
"github.com/seaweedfs/seaweedfs/weed/filer"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/filer/leveldb2/leveldb2_store_test.go b/weed/filer/leveldb2/leveldb2_store_test.go
index 34dc762daf..6f6667422f 100644
--- a/weed/filer/leveldb2/leveldb2_store_test.go
+++ b/weed/filer/leveldb2/leveldb2_store_test.go
@@ -2,10 +2,10 @@ package leveldb
import (
"context"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"testing"
"github.com/seaweedfs/seaweedfs/weed/filer"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/filer/leveldb3/leveldb3_store_bucket.go b/weed/filer/leveldb3/leveldb3_store_bucket.go
index 8cd3732aed..feb2a4b049 100644
--- a/weed/filer/leveldb3/leveldb3_store_bucket.go
+++ b/weed/filer/leveldb3/leveldb3_store_bucket.go
@@ -1,8 +1,9 @@
package leveldb
import (
- "github.com/seaweedfs/seaweedfs/weed/filer"
"os"
+
+ "github.com/seaweedfs/seaweedfs/weed/filer"
)
var _ filer.BucketAware = (*LevelDB3Store)(nil)
diff --git a/weed/filer/leveldb3/leveldb3_store_test.go b/weed/filer/leveldb3/leveldb3_store_test.go
index 6056e09550..aea6edd041 100644
--- a/weed/filer/leveldb3/leveldb3_store_test.go
+++ b/weed/filer/leveldb3/leveldb3_store_test.go
@@ -2,10 +2,10 @@ package leveldb
import (
"context"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"testing"
"github.com/seaweedfs/seaweedfs/weed/filer"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/filer/mysql/mysql_store.go b/weed/filer/mysql/mysql_store.go
index 9dbe09069d..a37d4dbd33 100644
--- a/weed/filer/mysql/mysql_store.go
+++ b/weed/filer/mysql/mysql_store.go
@@ -5,14 +5,13 @@ import (
"crypto/x509"
"database/sql"
"fmt"
- "github.com/go-sql-driver/mysql"
"os"
"strings"
"time"
- "github.com/seaweedfs/seaweedfs/weed/filer"
-
+ "github.com/go-sql-driver/mysql"
_ "github.com/go-sql-driver/mysql"
+ "github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/filer/abstract_sql"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/filer/read_remote.go b/weed/filer/read_remote.go
index bac0e5e825..4746810498 100644
--- a/weed/filer/read_remote.go
+++ b/weed/filer/read_remote.go
@@ -2,6 +2,7 @@ package filer
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/filer/reader_cache_test.go b/weed/filer/reader_cache_test.go
index 0480de8a74..3d04b73c7f 100644
--- a/weed/filer/reader_cache_test.go
+++ b/weed/filer/reader_cache_test.go
@@ -311,7 +311,7 @@ func TestSingleChunkCacherDoneSignal(t *testing.T) {
// TestSingleChunkCacherLookupError tests handling of lookup errors
func TestSingleChunkCacherLookupError(t *testing.T) {
cache := newMockChunkCacheForReaderCache()
-
+
// Lookup function that returns an error
lookupFn := func(ctx context.Context, fileId string) ([]string, error) {
return nil, fmt.Errorf("lookup failed for %s", fileId)
@@ -322,7 +322,7 @@ func TestSingleChunkCacherLookupError(t *testing.T) {
buffer := make([]byte, 100)
_, err := rc.ReadChunkAt(context.Background(), buffer, "error-test", nil, false, 0, 100, true)
-
+
if err == nil {
t.Error("Expected an error, got nil")
}
diff --git a/weed/filer/redis2/redis_sentinel_store.go b/weed/filer/redis2/redis_sentinel_store.go
index dc15285bd0..10ed622733 100644
--- a/weed/filer/redis2/redis_sentinel_store.go
+++ b/weed/filer/redis2/redis_sentinel_store.go
@@ -1,10 +1,11 @@
package redis2
import (
+ "time"
+
"github.com/redis/go-redis/v9"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/util"
- "time"
)
func init() {
diff --git a/weed/filer/redis3/kv_directory_children_test.go b/weed/filer/redis3/kv_directory_children_test.go
index 76a8dc00f8..3a42487dbd 100644
--- a/weed/filer/redis3/kv_directory_children_test.go
+++ b/weed/filer/redis3/kv_directory_children_test.go
@@ -3,11 +3,12 @@ package redis3
import (
"context"
"fmt"
- "github.com/redis/go-redis/v9"
- "github.com/stvp/tempredis"
"strconv"
"testing"
"time"
+
+ "github.com/redis/go-redis/v9"
+ "github.com/stvp/tempredis"
)
var names = []string{
diff --git a/weed/filer/redis3/skiplist_element_store.go b/weed/filer/redis3/skiplist_element_store.go
index 46506187ec..834e187181 100644
--- a/weed/filer/redis3/skiplist_element_store.go
+++ b/weed/filer/redis3/skiplist_element_store.go
@@ -3,6 +3,7 @@ package redis3
import (
"context"
"fmt"
+
"github.com/redis/go-redis/v9"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/util/skiplist"
diff --git a/weed/filer/redis_lua/redis_sentinel_store.go b/weed/filer/redis_lua/redis_sentinel_store.go
index 12a582ac33..6dd85dd06e 100644
--- a/weed/filer/redis_lua/redis_sentinel_store.go
+++ b/weed/filer/redis_lua/redis_sentinel_store.go
@@ -1,10 +1,11 @@
package redis_lua
import (
+ "time"
+
"github.com/redis/go-redis/v9"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/util"
- "time"
)
func init() {
diff --git a/weed/filer/redis_lua/stored_procedure/init.go b/weed/filer/redis_lua/stored_procedure/init.go
index 9373cc5a31..685ea364d6 100644
--- a/weed/filer/redis_lua/stored_procedure/init.go
+++ b/weed/filer/redis_lua/stored_procedure/init.go
@@ -2,6 +2,7 @@ package stored_procedure
import (
_ "embed"
+
"github.com/redis/go-redis/v9"
)
diff --git a/weed/filer/remote_mapping.go b/weed/filer/remote_mapping.go
index cc48d859ea..194411d54c 100644
--- a/weed/filer/remote_mapping.go
+++ b/weed/filer/remote_mapping.go
@@ -2,6 +2,7 @@ package filer
import (
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
diff --git a/weed/filer/remote_storage.go b/weed/filer/remote_storage.go
index 3764fbac6d..e52cc3ff33 100644
--- a/weed/filer/remote_storage.go
+++ b/weed/filer/remote_storage.go
@@ -3,14 +3,15 @@ package filer
import (
"context"
"fmt"
+ "math"
+ "strings"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/grpc"
"google.golang.org/protobuf/proto"
- "math"
- "strings"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
diff --git a/weed/filer/remote_storage_test.go b/weed/filer/remote_storage_test.go
index b3785db855..57c08634d7 100644
--- a/weed/filer/remote_storage_test.go
+++ b/weed/filer/remote_storage_test.go
@@ -1,9 +1,10 @@
package filer
import (
+ "testing"
+
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestFilerRemoteStorage_FindRemoteStorageClient(t *testing.T) {
diff --git a/weed/filer/ydb/ydb_store_kv.go b/weed/filer/ydb/ydb_store_kv.go
index 070f17e232..decec14ea0 100644
--- a/weed/filer/ydb/ydb_store_kv.go
+++ b/weed/filer/ydb/ydb_store_kv.go
@@ -6,6 +6,7 @@ package ydb
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/filer/abstract_sql"
"github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/filer/ydb/ydb_store_test.go b/weed/filer/ydb/ydb_store_test.go
index 1deef465c9..14ff769e9f 100644
--- a/weed/filer/ydb/ydb_store_test.go
+++ b/weed/filer/ydb/ydb_store_test.go
@@ -4,8 +4,9 @@
package ydb
import (
- "github.com/seaweedfs/seaweedfs/weed/filer/store_test"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/filer/store_test"
)
func TestStore(t *testing.T) {
diff --git a/weed/filer/ydb/ydb_types.go b/weed/filer/ydb/ydb_types.go
index 05e0b71732..af6ceec052 100644
--- a/weed/filer/ydb/ydb_types.go
+++ b/weed/filer/ydb/ydb_types.go
@@ -5,6 +5,7 @@ package ydb
import (
"fmt"
+
"github.com/ydb-platform/ydb-go-sdk/v3/table"
"github.com/ydb-platform/ydb-go-sdk/v3/table/options"
"github.com/ydb-platform/ydb-go-sdk/v3/table/types"
diff --git a/weed/glog/glog_file.go b/weed/glog/glog_file.go
index 631a4cc998..eef89802a3 100644
--- a/weed/glog/glog_file.go
+++ b/weed/glog/glog_file.go
@@ -21,7 +21,6 @@ package glog
import (
"errors"
"fmt"
- flag "github.com/seaweedfs/seaweedfs/weed/util/fla9"
"os"
"os/user"
"path/filepath"
@@ -29,6 +28,8 @@ import (
"strings"
"sync"
"time"
+
+ flag "github.com/seaweedfs/seaweedfs/weed/util/fla9"
)
// MaxSize is the maximum size of a log file in bytes.
diff --git a/weed/iam/sts/constants.go b/weed/iam/sts/constants.go
index b549519037..021aca9066 100644
--- a/weed/iam/sts/constants.go
+++ b/weed/iam/sts/constants.go
@@ -42,16 +42,16 @@ const (
// Configuration Field Names
const (
- ConfigFieldFilerAddress = "filerAddress"
- ConfigFieldBasePath = "basePath"
- ConfigFieldIssuer = "issuer"
- ConfigFieldClientID = "clientId"
- ConfigFieldClientSecret = "clientSecret"
- ConfigFieldJWKSUri = "jwksUri"
- ConfigFieldScopes = "scopes"
- ConfigFieldUserInfoUri = "userInfoUri"
- ConfigFieldRedirectUri = "redirectUri"
- ConfigFieldTLSCACert = "tlsCaCert"
+ ConfigFieldFilerAddress = "filerAddress"
+ ConfigFieldBasePath = "basePath"
+ ConfigFieldIssuer = "issuer"
+ ConfigFieldClientID = "clientId"
+ ConfigFieldClientSecret = "clientSecret"
+ ConfigFieldJWKSUri = "jwksUri"
+ ConfigFieldScopes = "scopes"
+ ConfigFieldUserInfoUri = "userInfoUri"
+ ConfigFieldRedirectUri = "redirectUri"
+ ConfigFieldTLSCACert = "tlsCaCert"
ConfigFieldTLSInsecureSkipVerify = "tlsInsecureSkipVerify"
)
diff --git a/weed/iam/sts/sts_service_test.go b/weed/iam/sts/sts_service_test.go
index 56b6755de7..7ab58c1896 100644
--- a/weed/iam/sts/sts_service_test.go
+++ b/weed/iam/sts/sts_service_test.go
@@ -457,7 +457,7 @@ func TestSessionDurationCappedByTokenExpiration(t *testing.T) {
service := NewSTSService()
config := &STSConfig{
- TokenDuration: FlexibleDuration{time.Hour}, // Default: 1 hour
+ TokenDuration: FlexibleDuration{time.Hour}, // Default: 1 hour
MaxSessionLength: FlexibleDuration{time.Hour * 12},
Issuer: "test-sts",
SigningKey: []byte("test-signing-key-32-characters-long"),
diff --git a/weed/iam/utils/arn_utils_test.go b/weed/iam/utils/arn_utils_test.go
index 7d0a8ce2d7..662297600a 100644
--- a/weed/iam/utils/arn_utils_test.go
+++ b/weed/iam/utils/arn_utils_test.go
@@ -453,10 +453,10 @@ func TestSecurityMaliciousSTSUserARNs(t *testing.T) {
// should be accepted as a valid role name "role/name".
func TestEdgeCaseMultipleRoleMarkers(t *testing.T) {
testCases := []struct {
- name string
- arn string
- expected string
- useSTS bool
+ name string
+ arn string
+ expected string
+ useSTS bool
}{
{
name: "legacy_format_role_in_path",
diff --git a/weed/images/orientation_test.go b/weed/images/orientation_test.go
index c90b85a445..fa4fdde159 100644
--- a/weed/images/orientation_test.go
+++ b/weed/images/orientation_test.go
@@ -1,9 +1,10 @@
package images
import (
- "github.com/seaweedfs/seaweedfs/weed/util"
"os"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
func TestXYZ(t *testing.T) {
diff --git a/weed/images/resizing_test.go b/weed/images/resizing_test.go
index 8e4bfaa25a..352cf660c9 100644
--- a/weed/images/resizing_test.go
+++ b/weed/images/resizing_test.go
@@ -2,9 +2,10 @@ package images
import (
"bytes"
- "github.com/seaweedfs/seaweedfs/weed/util"
"os"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
func TestResizing(t *testing.T) {
diff --git a/weed/mount/inode_to_path_test.go b/weed/mount/inode_to_path_test.go
index bbe9c4faa6..63da42feec 100644
--- a/weed/mount/inode_to_path_test.go
+++ b/weed/mount/inode_to_path_test.go
@@ -1,8 +1,9 @@
package mount
import (
- "github.com/seaweedfs/seaweedfs/weed/util"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
func TestInodeEntry_removeOnePath(t *testing.T) {
diff --git a/weed/mount/locked_entry.go b/weed/mount/locked_entry.go
index c5fbaee91a..0ea1fbfc94 100644
--- a/weed/mount/locked_entry.go
+++ b/weed/mount/locked_entry.go
@@ -1,8 +1,9 @@
package mount
import (
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"sync"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
type LockedEntry struct {
diff --git a/weed/mount/meta_cache/meta_cache.go b/weed/mount/meta_cache/meta_cache.go
index 45aff7aace..0b07949985 100644
--- a/weed/mount/meta_cache/meta_cache.go
+++ b/weed/mount/meta_cache/meta_cache.go
@@ -19,8 +19,8 @@ import (
// e.g. fill fileId field for chunks
type MetaCache struct {
- root util.FullPath
- localStore filer.VirtualFilerStore
+ root util.FullPath
+ localStore filer.VirtualFilerStore
leveldbStore *leveldb.LevelDBStore // direct reference for batch operations
sync.RWMutex
uidGidMapper *UidGidMapper
diff --git a/weed/mount/meta_cache/meta_cache_subscribe.go b/weed/mount/meta_cache/meta_cache_subscribe.go
index 9a4553013c..fd4271c39e 100644
--- a/weed/mount/meta_cache/meta_cache_subscribe.go
+++ b/weed/mount/meta_cache/meta_cache_subscribe.go
@@ -2,12 +2,13 @@ package meta_cache
import (
"context"
+ "strings"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
- "strings"
)
type MetadataFollower struct {
diff --git a/weed/mount/page_writer/chunk_interval_list_test.go b/weed/mount/page_writer/chunk_interval_list_test.go
index eb1d5ff46f..802130d6f2 100644
--- a/weed/mount/page_writer/chunk_interval_list_test.go
+++ b/weed/mount/page_writer/chunk_interval_list_test.go
@@ -1,8 +1,9 @@
package page_writer
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func Test_PageChunkWrittenIntervalList(t *testing.T) {
diff --git a/weed/mount/weedfs_forget.go b/weed/mount/weedfs_forget.go
index 0a45aba6b7..8cfd47dacd 100644
--- a/weed/mount/weedfs_forget.go
+++ b/weed/mount/weedfs_forget.go
@@ -2,6 +2,7 @@ package mount
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/mount/weedfs_grpc_server.go b/weed/mount/weedfs_grpc_server.go
index f867f2d80e..a247edbea4 100644
--- a/weed/mount/weedfs_grpc_server.go
+++ b/weed/mount/weedfs_grpc_server.go
@@ -3,6 +3,7 @@ package mount
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/mount_pb"
)
diff --git a/weed/mount/weedfs_quota_test.go b/weed/mount/weedfs_quota_test.go
index 47ae303410..9df747c95d 100644
--- a/weed/mount/weedfs_quota_test.go
+++ b/weed/mount/weedfs_quota_test.go
@@ -215,4 +215,3 @@ func TestNoQuotaTrackingWhenDisabled(t *testing.T) {
t.Errorf("Should not track uncommitted bytes when quota disabled: got %d", got)
}
}
-
diff --git a/weed/mount/weedfs_stats.go b/weed/mount/weedfs_stats.go
index 3e8d9f3bd5..a7975a619e 100644
--- a/weed/mount/weedfs_stats.go
+++ b/weed/mount/weedfs_stats.go
@@ -3,11 +3,12 @@ package mount
import (
"context"
"fmt"
+ "math"
+ "time"
+
"github.com/seaweedfs/go-fuse/v2/fuse"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
- "math"
- "time"
)
const blockSize = 512
diff --git a/weed/mq/agent/agent_grpc_pub_session.go b/weed/mq/agent/agent_grpc_pub_session.go
index 7cf857da13..e642e35bb8 100644
--- a/weed/mq/agent/agent_grpc_pub_session.go
+++ b/weed/mq/agent/agent_grpc_pub_session.go
@@ -2,11 +2,12 @@ package agent
import (
"context"
+ "log/slog"
+ "math/rand/v2"
+
"github.com/seaweedfs/seaweedfs/weed/mq/client/pub_client"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_agent_pb"
- "log/slog"
- "math/rand/v2"
)
func (a *MessageQueueAgent) StartPublishSession(ctx context.Context, req *mq_agent_pb.StartPublishSessionRequest) (*mq_agent_pb.StartPublishSessionResponse, error) {
diff --git a/weed/mq/agent/agent_grpc_publish.go b/weed/mq/agent/agent_grpc_publish.go
index 0b666ff6d4..5b776ad976 100644
--- a/weed/mq/agent/agent_grpc_publish.go
+++ b/weed/mq/agent/agent_grpc_publish.go
@@ -2,6 +2,7 @@ package agent
import (
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb/mq_agent_pb"
)
diff --git a/weed/mq/agent/agent_server.go b/weed/mq/agent/agent_server.go
index f1d6ec679d..97a80c435f 100644
--- a/weed/mq/agent/agent_server.go
+++ b/weed/mq/agent/agent_server.go
@@ -1,12 +1,13 @@
package agent
import (
+ "sync"
+
"github.com/seaweedfs/seaweedfs/weed/mq/client/pub_client"
"github.com/seaweedfs/seaweedfs/weed/mq/client/sub_client"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_agent_pb"
"google.golang.org/grpc"
- "sync"
)
type SessionId int64
diff --git a/weed/mq/broker/broker_grpc_admin.go b/weed/mq/broker/broker_grpc_admin.go
index 3c9ef282ca..f40a1d97d2 100644
--- a/weed/mq/broker/broker_grpc_admin.go
+++ b/weed/mq/broker/broker_grpc_admin.go
@@ -2,6 +2,7 @@ package broker
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
diff --git a/weed/mq/broker/broker_grpc_balance.go b/weed/mq/broker/broker_grpc_balance.go
index 54634c9d18..28baa228ee 100644
--- a/weed/mq/broker/broker_grpc_balance.go
+++ b/weed/mq/broker/broker_grpc_balance.go
@@ -2,6 +2,7 @@ package broker
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
)
diff --git a/weed/mq/broker/broker_grpc_topic_partition_control.go b/weed/mq/broker/broker_grpc_topic_partition_control.go
index 66547b010a..174a0a4553 100644
--- a/weed/mq/broker/broker_grpc_topic_partition_control.go
+++ b/weed/mq/broker/broker_grpc_topic_partition_control.go
@@ -2,6 +2,7 @@ package broker
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
)
diff --git a/weed/mq/client/agent_client/publish_session.go b/weed/mq/client/agent_client/publish_session.go
index 384f12f486..223de6c89a 100644
--- a/weed/mq/client/agent_client/publish_session.go
+++ b/weed/mq/client/agent_client/publish_session.go
@@ -3,6 +3,7 @@ package agent_client
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/mq/schema"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_agent_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
diff --git a/weed/mq/client/pub_client/publish.go b/weed/mq/client/pub_client/publish.go
index 1988e9279a..42aa68d1c6 100644
--- a/weed/mq/client/pub_client/publish.go
+++ b/weed/mq/client/pub_client/publish.go
@@ -2,12 +2,13 @@ package pub_client
import (
"fmt"
+ "time"
+
"github.com/golang/protobuf/proto"
"github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
- "time"
)
func (p *TopicPublisher) Publish(key, value []byte) error {
diff --git a/weed/mq/client/pub_client/publisher.go b/weed/mq/client/pub_client/publisher.go
index f95d006021..cad0f6bb96 100644
--- a/weed/mq/client/pub_client/publisher.go
+++ b/weed/mq/client/pub_client/publisher.go
@@ -1,6 +1,9 @@
package pub_client
import (
+ "log"
+ "sync"
+
"github.com/rdleal/intervalst/interval"
"github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
@@ -9,8 +12,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util/buffered_queue"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
- "log"
- "sync"
)
type PublisherConfiguration struct {
diff --git a/weed/mq/pub_balancer/allocate_test.go b/weed/mq/pub_balancer/allocate_test.go
index fc747634e7..c55f197368 100644
--- a/weed/mq/pub_balancer/allocate_test.go
+++ b/weed/mq/pub_balancer/allocate_test.go
@@ -2,11 +2,12 @@ package pub_balancer
import (
"fmt"
+ "testing"
+
cmap "github.com/orcaman/concurrent-map/v2"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
"github.com/stretchr/testify/assert"
- "testing"
)
func Test_allocateOneBroker(t *testing.T) {
diff --git a/weed/mq/pub_balancer/balance_action.go b/weed/mq/pub_balancer/balance_action.go
index a2d888b2a0..1c68991d13 100644
--- a/weed/mq/pub_balancer/balance_action.go
+++ b/weed/mq/pub_balancer/balance_action.go
@@ -3,6 +3,7 @@ package pub_balancer
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"google.golang.org/grpc"
diff --git a/weed/mq/pub_balancer/balance_brokers_test.go b/weed/mq/pub_balancer/balance_brokers_test.go
index 58731c24c4..1746804785 100644
--- a/weed/mq/pub_balancer/balance_brokers_test.go
+++ b/weed/mq/pub_balancer/balance_brokers_test.go
@@ -1,10 +1,11 @@
package pub_balancer
import (
- cmap "github.com/orcaman/concurrent-map/v2"
- "github.com/seaweedfs/seaweedfs/weed/mq/topic"
"reflect"
"testing"
+
+ cmap "github.com/orcaman/concurrent-map/v2"
+ "github.com/seaweedfs/seaweedfs/weed/mq/topic"
)
func TestBalanceTopicPartitionOnBrokers(t *testing.T) {
diff --git a/weed/mq/pub_balancer/broker_stats.go b/weed/mq/pub_balancer/broker_stats.go
index da016b7fd5..d6282b9d77 100644
--- a/weed/mq/pub_balancer/broker_stats.go
+++ b/weed/mq/pub_balancer/broker_stats.go
@@ -2,6 +2,7 @@ package pub_balancer
import (
"fmt"
+
cmap "github.com/orcaman/concurrent-map/v2"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
diff --git a/weed/mq/pub_balancer/lookup.go b/weed/mq/pub_balancer/lookup.go
index 5f9c7f32f6..9bf2712719 100644
--- a/weed/mq/pub_balancer/lookup.go
+++ b/weed/mq/pub_balancer/lookup.go
@@ -2,6 +2,7 @@ package pub_balancer
import (
"errors"
+
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
)
diff --git a/weed/mq/pub_balancer/repair_test.go b/weed/mq/pub_balancer/repair_test.go
index 08465c7e85..4ccf59e136 100644
--- a/weed/mq/pub_balancer/repair_test.go
+++ b/weed/mq/pub_balancer/repair_test.go
@@ -1,9 +1,10 @@
package pub_balancer
import (
- "github.com/seaweedfs/seaweedfs/weed/mq/topic"
"reflect"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/mq/topic"
)
func Test_findMissingPartitions(t *testing.T) {
diff --git a/weed/mq/schema/schema_test.go b/weed/mq/schema/schema_test.go
index f7dc8ff556..2d0068b220 100644
--- a/weed/mq/schema/schema_test.go
+++ b/weed/mq/schema/schema_test.go
@@ -2,10 +2,11 @@ package schema
import (
"encoding/json"
+ "testing"
+
"github.com/golang/protobuf/proto"
. "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestEnumScalarType(t *testing.T) {
diff --git a/weed/mq/schema/struct_to_schema_test.go b/weed/mq/schema/struct_to_schema_test.go
index fae27ecef6..9f21b854c2 100644
--- a/weed/mq/schema/struct_to_schema_test.go
+++ b/weed/mq/schema/struct_to_schema_test.go
@@ -1,9 +1,10 @@
package schema
import (
+ "testing"
+
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestStructToSchema(t *testing.T) {
diff --git a/weed/mq/schema/to_parquet_levels.go b/weed/mq/schema/to_parquet_levels.go
index f9fc073bb5..36e84f9c9b 100644
--- a/weed/mq/schema/to_parquet_levels.go
+++ b/weed/mq/schema/to_parquet_levels.go
@@ -2,6 +2,7 @@ package schema
import (
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
)
diff --git a/weed/mq/schema/to_parquet_levels_test.go b/weed/mq/schema/to_parquet_levels_test.go
index 5200c0e02e..8e6eacbd97 100644
--- a/weed/mq/schema/to_parquet_levels_test.go
+++ b/weed/mq/schema/to_parquet_levels_test.go
@@ -1,9 +1,10 @@
package schema
import (
+ "testing"
+
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestToParquetLevels(t *testing.T) {
diff --git a/weed/mq/segment/message_serde_test.go b/weed/mq/segment/message_serde_test.go
index a54ce57080..52c9d8e55c 100644
--- a/weed/mq/segment/message_serde_test.go
+++ b/weed/mq/segment/message_serde_test.go
@@ -1,10 +1,11 @@
package segment
import (
+ "testing"
+
flatbuffers "github.com/google/flatbuffers/go"
"github.com/seaweedfs/seaweedfs/weed/pb/message_fbs"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestMessageSerde(t *testing.T) {
diff --git a/weed/mq/sub_coordinator/consumer_group.go b/weed/mq/sub_coordinator/consumer_group.go
index ba94f34b45..538ae40414 100644
--- a/weed/mq/sub_coordinator/consumer_group.go
+++ b/weed/mq/sub_coordinator/consumer_group.go
@@ -2,13 +2,14 @@ package sub_coordinator
import (
"fmt"
+ "time"
+
cmap "github.com/orcaman/concurrent-map/v2"
"github.com/seaweedfs/seaweedfs/weed/filer_client"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
- "time"
)
type ConsumerGroup struct {
diff --git a/weed/mq/sub_coordinator/inflight_message_tracker_test.go b/weed/mq/sub_coordinator/inflight_message_tracker_test.go
index 5b7a1bdd80..a5c63d561c 100644
--- a/weed/mq/sub_coordinator/inflight_message_tracker_test.go
+++ b/weed/mq/sub_coordinator/inflight_message_tracker_test.go
@@ -1,8 +1,9 @@
package sub_coordinator
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func TestRingBuffer(t *testing.T) {
diff --git a/weed/mq/sub_coordinator/market.go b/weed/mq/sub_coordinator/market.go
index df07edfd59..1df4e0df4b 100644
--- a/weed/mq/sub_coordinator/market.go
+++ b/weed/mq/sub_coordinator/market.go
@@ -2,10 +2,11 @@ package sub_coordinator
import (
"errors"
- "github.com/seaweedfs/seaweedfs/weed/glog"
- "github.com/seaweedfs/seaweedfs/weed/mq/topic"
"sync"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/mq/topic"
)
/*
diff --git a/weed/mq/sub_coordinator/partition_consumer_mapping.go b/weed/mq/sub_coordinator/partition_consumer_mapping.go
index e900e4a33f..e4d00a0dd3 100644
--- a/weed/mq/sub_coordinator/partition_consumer_mapping.go
+++ b/weed/mq/sub_coordinator/partition_consumer_mapping.go
@@ -2,8 +2,9 @@ package sub_coordinator
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
)
type PartitionConsumerMapping struct {
diff --git a/weed/mq/sub_coordinator/partition_consumer_mapping_test.go b/weed/mq/sub_coordinator/partition_consumer_mapping_test.go
index 415eb27bdc..ccc4e86014 100644
--- a/weed/mq/sub_coordinator/partition_consumer_mapping_test.go
+++ b/weed/mq/sub_coordinator/partition_consumer_mapping_test.go
@@ -1,9 +1,10 @@
package sub_coordinator
import (
- "github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
"reflect"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
)
func Test_doBalanceSticky(t *testing.T) {
diff --git a/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go b/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go
index 131345f9c7..1e75379183 100644
--- a/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go
+++ b/weed/notification/gocdk_pub_sub/gocdk_pub_sub.go
@@ -20,24 +20,25 @@ package gocdk_pub_sub
import (
"context"
"fmt"
- amqp "github.com/rabbitmq/amqp091-go"
- "gocloud.dev/pubsub"
- _ "gocloud.dev/pubsub/awssnssqs"
- "gocloud.dev/pubsub/rabbitpubsub"
- "google.golang.org/protobuf/proto"
"net/url"
+ "os"
"path"
"sync"
"time"
+ amqp "github.com/rabbitmq/amqp091-go"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/notification"
"github.com/seaweedfs/seaweedfs/weed/util"
+ "gocloud.dev/pubsub"
+ _ "gocloud.dev/pubsub/awssnssqs"
+ "gocloud.dev/pubsub/rabbitpubsub"
+ "google.golang.org/protobuf/proto"
+
// _ "gocloud.dev/pubsub/azuresb"
_ "gocloud.dev/pubsub/gcppubsub"
_ "gocloud.dev/pubsub/natspubsub"
_ "gocloud.dev/pubsub/rabbitpubsub"
- "os"
)
func init() {
diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go
index 61fd2de480..2e429a8a12 100644
--- a/weed/operation/assign_file_id.go
+++ b/weed/operation/assign_file_id.go
@@ -3,13 +3,14 @@ package operation
import (
"context"
"fmt"
+ "sync"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"google.golang.org/grpc"
- "sync"
)
type VolumeAssignRequest struct {
diff --git a/weed/operation/assign_file_id_test.go b/weed/operation/assign_file_id_test.go
index b2ec7d92a7..ecfa7d6d0a 100644
--- a/weed/operation/assign_file_id_test.go
+++ b/weed/operation/assign_file_id_test.go
@@ -3,10 +3,11 @@ package operation
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
- "google.golang.org/grpc"
"testing"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb"
+ "google.golang.org/grpc"
)
func BenchmarkWithConcurrency(b *testing.B) {
diff --git a/weed/operation/buffer_pool.go b/weed/operation/buffer_pool.go
index 9cbe4787f3..316ba4995c 100644
--- a/weed/operation/buffer_pool.go
+++ b/weed/operation/buffer_pool.go
@@ -1,8 +1,9 @@
package operation
import (
- "github.com/valyala/bytebufferpool"
"sync/atomic"
+
+ "github.com/valyala/bytebufferpool"
)
var bufferCounter int64
diff --git a/weed/operation/submit.go b/weed/operation/submit.go
index 1efa42b2f5..4526a2c3a5 100644
--- a/weed/operation/submit.go
+++ b/weed/operation/submit.go
@@ -2,7 +2,6 @@ package operation
import (
"context"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"io"
"math/rand/v2"
"mime"
@@ -12,6 +11,8 @@ import (
"strconv"
"strings"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
+
"google.golang.org/grpc"
"github.com/seaweedfs/seaweedfs/weed/glog"
diff --git a/weed/operation/sync_volume.go b/weed/operation/sync_volume.go
index cb091aed8a..f1dde1b5a6 100644
--- a/weed/operation/sync_volume.go
+++ b/weed/operation/sync_volume.go
@@ -2,6 +2,7 @@ package operation
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"google.golang.org/grpc"
diff --git a/weed/pb/filer_pb/filer.pb.go b/weed/pb/filer_pb/filer.pb.go
index 7e2cdedf3c..279bd6d5d2 100644
--- a/weed/pb/filer_pb/filer.pb.go
+++ b/weed/pb/filer_pb/filer.pb.go
@@ -7,11 +7,12 @@
package filer_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/filer_pb/filer_client_bfs.go b/weed/pb/filer_pb/filer_client_bfs.go
index eb2e9ccee1..a3b4e98c9f 100644
--- a/weed/pb/filer_pb/filer_client_bfs.go
+++ b/weed/pb/filer_pb/filer_client_bfs.go
@@ -3,11 +3,12 @@ package filer_pb
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"io"
"sync"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/pb/filer_pb/filer_grpc.pb.go b/weed/pb/filer_pb/filer_grpc.pb.go
index e74a4c712b..b34996773d 100644
--- a/weed/pb/filer_pb/filer_grpc.pb.go
+++ b/weed/pb/filer_pb/filer_grpc.pb.go
@@ -8,6 +8,7 @@ package filer_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/filer_pb_tail.go b/weed/pb/filer_pb_tail.go
index d4e1e137e0..d61f0abb8c 100644
--- a/weed/pb/filer_pb_tail.go
+++ b/weed/pb/filer_pb_tail.go
@@ -3,12 +3,13 @@ package pb
import (
"context"
"fmt"
+ "io"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/grpc"
- "io"
- "time"
)
type EventErrorType int
diff --git a/weed/pb/iam_pb/iam.pb.go b/weed/pb/iam_pb/iam.pb.go
index 4b09764102..367afc5ef2 100644
--- a/weed/pb/iam_pb/iam.pb.go
+++ b/weed/pb/iam_pb/iam.pb.go
@@ -7,11 +7,12 @@
package iam_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/master_pb/master.pb.go b/weed/pb/master_pb/master.pb.go
index fc2ceec4c2..e8376011e7 100644
--- a/weed/pb/master_pb/master.pb.go
+++ b/weed/pb/master_pb/master.pb.go
@@ -7,11 +7,12 @@
package master_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/master_pb/master_grpc.pb.go b/weed/pb/master_pb/master_grpc.pb.go
index 441c2ffb11..719e8bb381 100644
--- a/weed/pb/master_pb/master_grpc.pb.go
+++ b/weed/pb/master_pb/master_grpc.pb.go
@@ -8,6 +8,7 @@ package master_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/mount_pb/mount.pb.go b/weed/pb/mount_pb/mount.pb.go
index 1299f6beca..f5420f567a 100644
--- a/weed/pb/mount_pb/mount.pb.go
+++ b/weed/pb/mount_pb/mount.pb.go
@@ -7,11 +7,12 @@
package mount_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/mount_pb/mount_grpc.pb.go b/weed/pb/mount_pb/mount_grpc.pb.go
index 6a12813264..b4a9d7e297 100644
--- a/weed/pb/mount_pb/mount_grpc.pb.go
+++ b/weed/pb/mount_pb/mount_grpc.pb.go
@@ -8,6 +8,7 @@ package mount_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/mq_agent_pb/mq_agent.pb.go b/weed/pb/mq_agent_pb/mq_agent.pb.go
index 1558192805..3a89495cba 100644
--- a/weed/pb/mq_agent_pb/mq_agent.pb.go
+++ b/weed/pb/mq_agent_pb/mq_agent.pb.go
@@ -7,12 +7,13 @@
package mq_agent_pb
import (
- schema_pb "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ schema_pb "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/mq_agent_pb/mq_agent_grpc.pb.go b/weed/pb/mq_agent_pb/mq_agent_grpc.pb.go
index 62e323d131..7135ced0c9 100644
--- a/weed/pb/mq_agent_pb/mq_agent_grpc.pb.go
+++ b/weed/pb/mq_agent_pb/mq_agent_grpc.pb.go
@@ -8,6 +8,7 @@ package mq_agent_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/mq_agent_pb/publish_response_test.go b/weed/pb/mq_agent_pb/publish_response_test.go
index 0c7b0ee3a4..0a6827fc91 100644
--- a/weed/pb/mq_agent_pb/publish_response_test.go
+++ b/weed/pb/mq_agent_pb/publish_response_test.go
@@ -1,8 +1,9 @@
package mq_agent_pb
import (
- "google.golang.org/protobuf/proto"
"testing"
+
+ "google.golang.org/protobuf/proto"
)
func TestPublishRecordResponseSerialization(t *testing.T) {
diff --git a/weed/pb/mq_pb/mq_broker.pb.go b/weed/pb/mq_pb/mq_broker.pb.go
index 88affa1633..58672cb981 100644
--- a/weed/pb/mq_pb/mq_broker.pb.go
+++ b/weed/pb/mq_pb/mq_broker.pb.go
@@ -7,13 +7,14 @@
package mq_pb
import (
+ reflect "reflect"
+ sync "sync"
+ unsafe "unsafe"
+
filer_pb "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
schema_pb "github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- reflect "reflect"
- sync "sync"
- unsafe "unsafe"
)
const (
diff --git a/weed/pb/mq_pb/mq_broker_grpc.pb.go b/weed/pb/mq_pb/mq_broker_grpc.pb.go
index 1abefb75bc..ea972974e6 100644
--- a/weed/pb/mq_pb/mq_broker_grpc.pb.go
+++ b/weed/pb/mq_pb/mq_broker_grpc.pb.go
@@ -8,6 +8,7 @@ package mq_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/remote_pb/remote.pb.go b/weed/pb/remote_pb/remote.pb.go
index f7b3866c50..2c9e2389b9 100644
--- a/weed/pb/remote_pb/remote.pb.go
+++ b/weed/pb/remote_pb/remote.pb.go
@@ -7,11 +7,12 @@
package remote_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/s3_pb/s3.pb.go b/weed/pb/s3_pb/s3.pb.go
index 67d6ef11d3..c440715945 100644
--- a/weed/pb/s3_pb/s3.pb.go
+++ b/weed/pb/s3_pb/s3.pb.go
@@ -7,11 +7,12 @@
package s3_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/s3_pb/s3_grpc.pb.go b/weed/pb/s3_pb/s3_grpc.pb.go
index f5f43f54f6..daef9cf301 100644
--- a/weed/pb/s3_pb/s3_grpc.pb.go
+++ b/weed/pb/s3_pb/s3_grpc.pb.go
@@ -8,6 +8,7 @@ package s3_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/schema_pb/mq_schema.pb.go b/weed/pb/schema_pb/mq_schema.pb.go
index 45d04c7bd2..246615daff 100644
--- a/weed/pb/schema_pb/mq_schema.pb.go
+++ b/weed/pb/schema_pb/mq_schema.pb.go
@@ -7,11 +7,12 @@
package schema_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/schema_pb/offset_test.go b/weed/pb/schema_pb/offset_test.go
index 273d2d5d1f..69aeb812ca 100644
--- a/weed/pb/schema_pb/offset_test.go
+++ b/weed/pb/schema_pb/offset_test.go
@@ -1,8 +1,9 @@
package schema_pb
import (
- "google.golang.org/protobuf/proto"
"testing"
+
+ "google.golang.org/protobuf/proto"
)
func TestOffsetTypeEnums(t *testing.T) {
diff --git a/weed/pb/server_discovery.go b/weed/pb/server_discovery.go
index 25c0360c5b..59a333f0a2 100644
--- a/weed/pb/server_discovery.go
+++ b/weed/pb/server_discovery.go
@@ -1,8 +1,9 @@
package pb
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
"reflect"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
)
// ServerDiscovery encodes a way to find at least 1 instance of a service,
diff --git a/weed/pb/volume_server_pb/volume_server.pb.go b/weed/pb/volume_server_pb/volume_server.pb.go
index 7b174f8dd1..cf0ad3ffbb 100644
--- a/weed/pb/volume_server_pb/volume_server.pb.go
+++ b/weed/pb/volume_server_pb/volume_server.pb.go
@@ -7,12 +7,13 @@
package volume_server_pb
import (
- remote_pb "github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ remote_pb "github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/volume_server_pb/volume_server_grpc.pb.go b/weed/pb/volume_server_pb/volume_server_grpc.pb.go
index 02818ab387..690ee99fcf 100644
--- a/weed/pb/volume_server_pb/volume_server_grpc.pb.go
+++ b/weed/pb/volume_server_pb/volume_server_grpc.pb.go
@@ -8,6 +8,7 @@ package volume_server_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/pb/worker_pb/worker.pb.go b/weed/pb/worker_pb/worker.pb.go
index f0bd661c14..a24dd92b08 100644
--- a/weed/pb/worker_pb/worker.pb.go
+++ b/weed/pb/worker_pb/worker.pb.go
@@ -7,11 +7,12 @@
package worker_pb
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
unsafe "unsafe"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/pb/worker_pb/worker_grpc.pb.go b/weed/pb/worker_pb/worker_grpc.pb.go
index 0b0a9ad094..4894e7d25d 100644
--- a/weed/pb/worker_pb/worker_grpc.pb.go
+++ b/weed/pb/worker_pb/worker_grpc.pb.go
@@ -8,6 +8,7 @@ package worker_pb
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
diff --git a/weed/remote_storage/remote_storage.go b/weed/remote_storage/remote_storage.go
index 93b0b9d843..04d9520e65 100644
--- a/weed/remote_storage/remote_storage.go
+++ b/weed/remote_storage/remote_storage.go
@@ -2,14 +2,15 @@ package remote_storage
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
- "github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
- "google.golang.org/protobuf/proto"
"io"
"sort"
"strings"
"sync"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
+ "github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
+ "google.golang.org/protobuf/proto"
)
const slash = "/"
diff --git a/weed/remote_storage/s3/aliyun.go b/weed/remote_storage/s3/aliyun.go
index 19a0ef4aec..667ef72a5f 100644
--- a/weed/remote_storage/s3/aliyun.go
+++ b/weed/remote_storage/s3/aliyun.go
@@ -2,6 +2,8 @@ package s3
import (
"fmt"
+ "os"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
@@ -9,7 +11,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "os"
)
func init() {
diff --git a/weed/remote_storage/s3/backblaze.go b/weed/remote_storage/s3/backblaze.go
index 0f42730c93..4878268382 100644
--- a/weed/remote_storage/s3/backblaze.go
+++ b/weed/remote_storage/s3/backblaze.go
@@ -2,6 +2,7 @@ package s3
import (
"fmt"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
diff --git a/weed/remote_storage/s3/filebase.go b/weed/remote_storage/s3/filebase.go
index ed8cfb409f..6640e2a14a 100644
--- a/weed/remote_storage/s3/filebase.go
+++ b/weed/remote_storage/s3/filebase.go
@@ -2,6 +2,8 @@ package s3
import (
"fmt"
+ "os"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
@@ -10,7 +12,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "os"
)
func init() {
diff --git a/weed/remote_storage/s3/s3_storage_client.go b/weed/remote_storage/s3/s3_storage_client.go
index 280a856b05..9bf114b116 100644
--- a/weed/remote_storage/s3/s3_storage_client.go
+++ b/weed/remote_storage/s3/s3_storage_client.go
@@ -2,7 +2,6 @@ package s3
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"io"
"reflect"
@@ -19,6 +18,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
func init() {
diff --git a/weed/remote_storage/s3/storj.go b/weed/remote_storage/s3/storj.go
index dd2fead565..c58ebf7c64 100644
--- a/weed/remote_storage/s3/storj.go
+++ b/weed/remote_storage/s3/storj.go
@@ -2,6 +2,8 @@ package s3
import (
"fmt"
+ "os"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
@@ -9,7 +11,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "os"
)
func init() {
diff --git a/weed/remote_storage/s3/tencent.go b/weed/remote_storage/s3/tencent.go
index d010b03b91..c0da1fa05e 100644
--- a/weed/remote_storage/s3/tencent.go
+++ b/weed/remote_storage/s3/tencent.go
@@ -2,6 +2,8 @@ package s3
import (
"fmt"
+ "os"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
@@ -9,7 +11,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "os"
)
func init() {
diff --git a/weed/remote_storage/s3/wasabi.go b/weed/remote_storage/s3/wasabi.go
index 8d330a29fc..08e5c951ba 100644
--- a/weed/remote_storage/s3/wasabi.go
+++ b/weed/remote_storage/s3/wasabi.go
@@ -2,6 +2,7 @@ package s3
import (
"fmt"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/request"
diff --git a/weed/remote_storage/track_sync_offset.go b/weed/remote_storage/track_sync_offset.go
index 38cb7bd249..f5de002d08 100644
--- a/weed/remote_storage/track_sync_offset.go
+++ b/weed/remote_storage/track_sync_offset.go
@@ -3,6 +3,7 @@ package remote_storage
import (
"context"
"errors"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/replication/replicator.go b/weed/replication/replicator.go
index 654725725e..5ea7c3a2ce 100644
--- a/weed/replication/replicator.go
+++ b/weed/replication/replicator.go
@@ -3,16 +3,16 @@ package replication
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
- "google.golang.org/grpc"
"strings"
"time"
"github.com/seaweedfs/seaweedfs/weed/glog"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/replication/sink"
"github.com/seaweedfs/seaweedfs/weed/replication/source"
"github.com/seaweedfs/seaweedfs/weed/util"
+ "google.golang.org/grpc"
)
type Replicator struct {
diff --git a/weed/replication/sink/b2sink/b2_sink.go b/weed/replication/sink/b2sink/b2_sink.go
index 90f77f4410..910465ead0 100644
--- a/weed/replication/sink/b2sink/b2_sink.go
+++ b/weed/replication/sink/b2sink/b2_sink.go
@@ -2,12 +2,12 @@ package B2Sink
import (
"context"
- "github.com/seaweedfs/seaweedfs/weed/replication/repl_util"
"strings"
"github.com/kurin/blazer/b2"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
+ "github.com/seaweedfs/seaweedfs/weed/replication/repl_util"
"github.com/seaweedfs/seaweedfs/weed/replication/sink"
"github.com/seaweedfs/seaweedfs/weed/replication/source"
"github.com/seaweedfs/seaweedfs/weed/util"
diff --git a/weed/replication/sink/filersink/filer_sink.go b/weed/replication/sink/filersink/filer_sink.go
index 8b4b0e513b..74e2b3a5ac 100644
--- a/weed/replication/sink/filersink/filer_sink.go
+++ b/weed/replication/sink/filersink/filer_sink.go
@@ -3,9 +3,10 @@ package filersink
import (
"context"
"fmt"
+ "math"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
- "math"
"google.golang.org/grpc"
diff --git a/weed/replication/sink/localsink/local_sink.go b/weed/replication/sink/localsink/local_sink.go
index 2e962d1d04..1bb3f26604 100644
--- a/weed/replication/sink/localsink/local_sink.go
+++ b/weed/replication/sink/localsink/local_sink.go
@@ -2,6 +2,10 @@ package localsink
import (
"context"
+ "os"
+ "path/filepath"
+ "strings"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@@ -10,9 +14,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/replication/source"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/util"
- "os"
- "path/filepath"
- "strings"
)
type LocalSink struct {
diff --git a/weed/replication/sink/s3sink/s3_sink.go b/weed/replication/sink/s3sink/s3_sink.go
index 28428545b4..9b5b78fd94 100644
--- a/weed/replication/sink/s3sink/s3_sink.go
+++ b/weed/replication/sink/s3sink/s3_sink.go
@@ -3,6 +3,9 @@ package S3Sink
import (
"encoding/base64"
"fmt"
+ "strconv"
+ "strings"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
@@ -10,8 +13,6 @@ import (
"github.com/aws/aws-sdk-go/service/s3/s3iface"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
- "strconv"
- "strings"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/glog"
diff --git a/weed/replication/sub/notification_gocdk_pub_sub.go b/weed/replication/sub/notification_gocdk_pub_sub.go
index 2e7640af4f..0632c6bf01 100644
--- a/weed/replication/sub/notification_gocdk_pub_sub.go
+++ b/weed/replication/sub/notification_gocdk_pub_sub.go
@@ -5,6 +5,12 @@ package sub
import (
"context"
+ "net/url"
+ "os"
+ "path"
+ "strings"
+ "time"
+
amqp "github.com/rabbitmq/amqp091-go"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@@ -13,11 +19,6 @@ import (
_ "gocloud.dev/pubsub/awssnssqs"
"gocloud.dev/pubsub/rabbitpubsub"
"google.golang.org/protobuf/proto"
- "net/url"
- "os"
- "path"
- "strings"
- "time"
// _ "gocloud.dev/pubsub/azuresb"
_ "gocloud.dev/pubsub/gcppubsub"
diff --git a/weed/s3api/bucket_metadata_test.go b/weed/s3api/bucket_metadata_test.go
index 16d20b8fea..6d9468c324 100644
--- a/weed/s3api/bucket_metadata_test.go
+++ b/weed/s3api/bucket_metadata_test.go
@@ -3,15 +3,16 @@ package s3api
import (
"encoding/json"
"fmt"
+ "reflect"
+ "sync"
+ "testing"
+ "time"
+
"github.com/aws/aws-sdk-go/service/s3"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/iam_pb"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
- "reflect"
- "sync"
- "testing"
- "time"
)
type BucketMetadataTestCase struct {
diff --git a/weed/s3api/filer_multipart_test.go b/weed/s3api/filer_multipart_test.go
index bf4fa3ca24..f407e268ef 100644
--- a/weed/s3api/filer_multipart_test.go
+++ b/weed/s3api/filer_multipart_test.go
@@ -84,11 +84,11 @@ func TestGetEntryNameAndDir(t *testing.T) {
}
tests := []struct {
- name string
- bucket string
- key string
- expectedName string
- expectedDirEnd string // We check the suffix since dir includes BucketsPath
+ name string
+ bucket string
+ key string
+ expectedName string
+ expectedDirEnd string // We check the suffix since dir includes BucketsPath
}{
{
name: "simple file at root",
diff --git a/weed/s3api/filer_util_tags.go b/weed/s3api/filer_util_tags.go
index d33e46c2e5..ee2f5da33b 100644
--- a/weed/s3api/filer_util_tags.go
+++ b/weed/s3api/filer_util_tags.go
@@ -2,10 +2,10 @@ package s3api
import (
"context"
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"strings"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
)
const (
diff --git a/weed/s3api/policy/post-policy.go b/weed/s3api/policy/post-policy.go
index ad3cfc401e..3250cdf496 100644
--- a/weed/s3api/policy/post-policy.go
+++ b/weed/s3api/policy/post-policy.go
@@ -20,10 +20,11 @@ package policy
import (
"encoding/base64"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
"net/http"
"strings"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
)
// expirationDateFormat date format for expiration key in json policy.
diff --git a/weed/s3api/s3_constants/buckets.go b/weed/s3api/s3_constants/buckets.go
index 97f86d5698..a10cf0f504 100644
--- a/weed/s3api/s3_constants/buckets.go
+++ b/weed/s3api/s3_constants/buckets.go
@@ -4,4 +4,3 @@ const (
// DefaultBucketsPath is the default path for S3 buckets in the filer
DefaultBucketsPath = "/buckets"
)
-
diff --git a/weed/s3api/s3_constants/extend_key.go b/weed/s3api/s3_constants/extend_key.go
index 985160b528..56f2ac1ead 100644
--- a/weed/s3api/s3_constants/extend_key.go
+++ b/weed/s3api/s3_constants/extend_key.go
@@ -12,12 +12,12 @@ const (
ExtLatestVersionIdKey = "Seaweed-X-Amz-Latest-Version-Id"
ExtLatestVersionFileNameKey = "Seaweed-X-Amz-Latest-Version-File-Name"
// Cached list metadata in .versions directory for single-scan efficiency
- ExtLatestVersionSizeKey = "Seaweed-X-Amz-Latest-Version-Size"
- ExtLatestVersionETagKey = "Seaweed-X-Amz-Latest-Version-ETag"
- ExtLatestVersionMtimeKey = "Seaweed-X-Amz-Latest-Version-Mtime"
- ExtLatestVersionOwnerKey = "Seaweed-X-Amz-Latest-Version-Owner"
- ExtLatestVersionIsDeleteMarker = "Seaweed-X-Amz-Latest-Version-Is-Delete-Marker"
- ExtMultipartObjectKey = "key"
+ ExtLatestVersionSizeKey = "Seaweed-X-Amz-Latest-Version-Size"
+ ExtLatestVersionETagKey = "Seaweed-X-Amz-Latest-Version-ETag"
+ ExtLatestVersionMtimeKey = "Seaweed-X-Amz-Latest-Version-Mtime"
+ ExtLatestVersionOwnerKey = "Seaweed-X-Amz-Latest-Version-Owner"
+ ExtLatestVersionIsDeleteMarker = "Seaweed-X-Amz-Latest-Version-Is-Delete-Marker"
+ ExtMultipartObjectKey = "key"
// Bucket Policy
ExtBucketPolicyKey = "Seaweed-X-Amz-Bucket-Policy"
diff --git a/weed/s3api/s3_existing_object_tag_test.go b/weed/s3api/s3_existing_object_tag_test.go
index 65cca9f1a5..0adea69766 100644
--- a/weed/s3api/s3_existing_object_tag_test.go
+++ b/weed/s3api/s3_existing_object_tag_test.go
@@ -257,4 +257,3 @@ func TestHasPolicyForBucket(t *testing.T) {
// No longer has policy
assert.False(t, engine.HasPolicyForBucket("test-bucket"))
}
-
diff --git a/weed/s3api/s3api_acl_helper_test.go b/weed/s3api/s3api_acl_helper_test.go
index 81ce255758..d3a625ce20 100644
--- a/weed/s3api/s3api_acl_helper_test.go
+++ b/weed/s3api/s3api_acl_helper_test.go
@@ -3,15 +3,16 @@ package s3api
import (
"bytes"
"encoding/json"
+ "io"
+ "net/http"
+ "testing"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/iam_pb"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
- "io"
- "net/http"
- "testing"
)
var accountManager *IdentityAccessManagement
diff --git a/weed/s3api/s3api_acp.go b/weed/s3api/s3api_acp.go
index 0a79990f57..a3ac2ebb12 100644
--- a/weed/s3api/s3api_acp.go
+++ b/weed/s3api/s3api_acp.go
@@ -1,9 +1,10 @@
package s3api
import (
+ "net/http"
+
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
- "net/http"
)
func getAccountId(r *http.Request) string {
diff --git a/weed/s3api/s3api_bucket_handlers_object_lock_config.go b/weed/s3api/s3api_bucket_handlers_object_lock_config.go
index 23b52648ed..a6b4226172 100644
--- a/weed/s3api/s3api_bucket_handlers_object_lock_config.go
+++ b/weed/s3api/s3api_bucket_handlers_object_lock_config.go
@@ -88,7 +88,7 @@ func (s3a *S3ApiServer) GetObjectLockConfigurationHandler(w http.ResponseWriter,
if bucketConfig.ObjectLockConfig != nil {
// Set namespace for S3 compatibility
bucketConfig.ObjectLockConfig.XMLNS = s3_constants.S3Namespace
-
+
// Use cached configuration and marshal it to XML for response
marshaledXML, err := xml.Marshal(bucketConfig.ObjectLockConfig)
if err != nil {
diff --git a/weed/s3api/s3api_circuit_breaker.go b/weed/s3api/s3api_circuit_breaker.go
index e19caf91bc..0b6dc160e4 100644
--- a/weed/s3api/s3api_circuit_breaker.go
+++ b/weed/s3api/s3api_circuit_breaker.go
@@ -93,9 +93,9 @@ func (cb *CircuitBreaker) loadCircuitBreakerConfig(cfg *s3_pb.S3CircuitBreakerCo
func (cb *CircuitBreaker) Limit(f func(w http.ResponseWriter, r *http.Request), action string) (http.HandlerFunc, Action) {
return func(w http.ResponseWriter, r *http.Request) {
// Apply upload limiting for write actions if configured
- if cb.s3a != nil && (action == s3_constants.ACTION_WRITE) &&
+ if cb.s3a != nil && (action == s3_constants.ACTION_WRITE) &&
(cb.s3a.option.ConcurrentUploadLimit != 0 || cb.s3a.option.ConcurrentFileUploadLimit != 0) {
-
+
// Get content length, default to 0 if not provided
contentLength := r.ContentLength
if contentLength < 0 {
@@ -108,12 +108,12 @@ func (cb *CircuitBreaker) Limit(f func(w http.ResponseWriter, r *http.Request),
inFlightUploads := atomic.LoadInt64(&cb.s3a.inFlightUploads)
// Wait if either data size limit or file count limit is exceeded
- for (cb.s3a.option.ConcurrentUploadLimit != 0 && inFlightDataSize > cb.s3a.option.ConcurrentUploadLimit) ||
+ for (cb.s3a.option.ConcurrentUploadLimit != 0 && inFlightDataSize > cb.s3a.option.ConcurrentUploadLimit) ||
(cb.s3a.option.ConcurrentFileUploadLimit != 0 && inFlightUploads >= cb.s3a.option.ConcurrentFileUploadLimit) {
- if (cb.s3a.option.ConcurrentUploadLimit != 0 && inFlightDataSize > cb.s3a.option.ConcurrentUploadLimit) {
+ if cb.s3a.option.ConcurrentUploadLimit != 0 && inFlightDataSize > cb.s3a.option.ConcurrentUploadLimit {
glog.V(4).Infof("wait because inflight data %d > %d", inFlightDataSize, cb.s3a.option.ConcurrentUploadLimit)
}
- if (cb.s3a.option.ConcurrentFileUploadLimit != 0 && inFlightUploads >= cb.s3a.option.ConcurrentFileUploadLimit) {
+ if cb.s3a.option.ConcurrentFileUploadLimit != 0 && inFlightUploads >= cb.s3a.option.ConcurrentFileUploadLimit {
glog.V(4).Infof("wait because inflight uploads %d >= %d", inFlightUploads, cb.s3a.option.ConcurrentFileUploadLimit)
}
cb.s3a.inFlightDataLimitCond.Wait()
diff --git a/weed/s3api/s3api_circuit_breaker_test.go b/weed/s3api/s3api_circuit_breaker_test.go
index aa81675444..72e166558a 100644
--- a/weed/s3api/s3api_circuit_breaker_test.go
+++ b/weed/s3api/s3api_circuit_breaker_test.go
@@ -1,13 +1,14 @@
package s3api
import (
- "github.com/seaweedfs/seaweedfs/weed/pb/s3_pb"
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
"net/http"
"sync"
"sync/atomic"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/s3_pb"
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
)
type TestLimitCase struct {
diff --git a/weed/s3api/s3api_encrypted_volume_copy_test.go b/weed/s3api/s3api_encrypted_volume_copy_test.go
index 7e84384fbe..169a0f6162 100644
--- a/weed/s3api/s3api_encrypted_volume_copy_test.go
+++ b/weed/s3api/s3api_encrypted_volume_copy_test.go
@@ -173,4 +173,3 @@ func TestEncryptedVolumeCopyScenario(t *testing.T) {
t.Log("✓ All chunk metadata properly preserved for encrypted volume copy scenario")
})
}
-
diff --git a/weed/s3api/s3api_handlers.go b/weed/s3api/s3api_handlers.go
index 6c47e8256a..00c8834b0d 100644
--- a/weed/s3api/s3api_handlers.go
+++ b/weed/s3api/s3api_handlers.go
@@ -20,7 +20,7 @@ func (s3a *S3ApiServer) WithFilerClient(streamingMode bool, fn func(filer_pb.Sea
if s3a.filerClient != nil {
return s3a.withFilerClientFailover(streamingMode, fn)
}
-
+
// Fallback to direct connection if filerClient not initialized
// This should only happen during initialization or testing
return pb.WithGrpcClient(streamingMode, s3a.randomClientId, func(grpcConnection *grpc.ClientConn) error {
@@ -34,41 +34,41 @@ func (s3a *S3ApiServer) WithFilerClient(streamingMode bool, fn func(filer_pb.Sea
func (s3a *S3ApiServer) withFilerClientFailover(streamingMode bool, fn func(filer_pb.SeaweedFilerClient) error) error {
// Get current filer as starting point
currentFiler := s3a.filerClient.GetCurrentFiler()
-
+
// Try current filer first (fast path)
err := pb.WithGrpcClient(streamingMode, s3a.randomClientId, func(grpcConnection *grpc.ClientConn) error {
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
return fn(client)
}, currentFiler.ToGrpcAddress(), false, s3a.option.GrpcDialOption)
-
+
if err == nil {
s3a.filerClient.RecordFilerSuccess(currentFiler)
return nil
}
-
+
// Record failure for current filer
s3a.filerClient.RecordFilerFailure(currentFiler)
-
+
// Current filer failed - try all other filers with health-aware selection
filers := s3a.filerClient.GetAllFilers()
var lastErr error = err
-
+
for _, filer := range filers {
if filer == currentFiler {
continue // Already tried this one
}
-
+
// Skip filers known to be unhealthy (circuit breaker pattern)
if s3a.filerClient.ShouldSkipUnhealthyFiler(filer) {
glog.V(2).Infof("WithFilerClient: skipping unhealthy filer %s", filer)
continue
}
-
+
err = pb.WithGrpcClient(streamingMode, s3a.randomClientId, func(grpcConnection *grpc.ClientConn) error {
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
return fn(client)
}, filer.ToGrpcAddress(), false, s3a.option.GrpcDialOption)
-
+
if err == nil {
// Success! Record success and update current filer for future requests
s3a.filerClient.RecordFilerSuccess(filer)
@@ -76,13 +76,13 @@ func (s3a *S3ApiServer) withFilerClientFailover(streamingMode bool, fn func(file
glog.V(1).Infof("WithFilerClient: failover from %s to %s succeeded", currentFiler, filer)
return nil
}
-
+
// Record failure for health tracking
s3a.filerClient.RecordFilerFailure(filer)
glog.V(2).Infof("WithFilerClient: failover to %s failed: %v", filer, err)
lastErr = err
}
-
+
// All filers failed
return fmt.Errorf("all filers failed, last error: %w", lastErr)
}
diff --git a/weed/s3api/s3api_list_normalization_test.go b/weed/s3api/s3api_list_normalization_test.go
index 128457b8fb..8f4d91cdea 100644
--- a/weed/s3api/s3api_list_normalization_test.go
+++ b/weed/s3api/s3api_list_normalization_test.go
@@ -44,7 +44,7 @@ func TestPrefixNormalizationInList(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
// Normalize using NormalizeObjectKey (same as object keys)
normalizedPrefix := s3_constants.NormalizeObjectKey(tt.inputPrefix)
-
+
if normalizedPrefix != tt.expectedPrefix {
t.Errorf("Prefix normalization mismatch:\n Input: %q\n Expected: %q\n Got: %q\n Desc: %s",
tt.inputPrefix, tt.expectedPrefix, normalizedPrefix, tt.description)
@@ -75,11 +75,11 @@ func TestListPrefixConsistency(t *testing.T) {
func startsWithPrefix(objectKey, prefix string) bool {
// Normalize the prefix using the same logic as NormalizeObjectKey
normalizedPrefix := s3_constants.NormalizeObjectKey(prefix)
-
+
// Check if the object starts with the normalized prefix
if normalizedPrefix == "" {
return true
}
-
+
return objectKey == normalizedPrefix || objectKey[:len(normalizedPrefix)] == normalizedPrefix
}
diff --git a/weed/s3api/s3api_server_grpc.go b/weed/s3api/s3api_server_grpc.go
index 93da82c180..b421b05748 100644
--- a/weed/s3api/s3api_server_grpc.go
+++ b/weed/s3api/s3api_server_grpc.go
@@ -2,6 +2,7 @@ package s3api
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/pb/s3_pb"
)
diff --git a/weed/s3api/s3api_status_handlers.go b/weed/s3api/s3api_status_handlers.go
index e5d8b96b8b..e868a135ff 100644
--- a/weed/s3api/s3api_status_handlers.go
+++ b/weed/s3api/s3api_status_handlers.go
@@ -1,8 +1,9 @@
package s3api
import (
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
"net/http"
+
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
)
func (s3a *S3ApiServer) StatusHandler(w http.ResponseWriter, r *http.Request) {
diff --git a/weed/s3api/s3api_streaming_copy.go b/weed/s3api/s3api_streaming_copy.go
index 94729c003d..f50f715e3c 100644
--- a/weed/s3api/s3api_streaming_copy.go
+++ b/weed/s3api/s3api_streaming_copy.go
@@ -459,8 +459,8 @@ func (scm *StreamingCopyManager) streamToChunks(ctx context.Context, reader io.R
for {
n, err := reader.Read(buffer)
if n > 0 {
- // Create chunk for this data, setting SSE type and per-chunk metadata (including chunk-specific IVs for SSE-S3)
- chunk, chunkErr := scm.createChunkFromData(buffer[:n], offset, dstPath, spec.EncryptionSpec)
+ // Create chunk for this data, setting SSE type and per-chunk metadata (including chunk-specific IVs for SSE-S3)
+ chunk, chunkErr := scm.createChunkFromData(buffer[:n], offset, dstPath, spec.EncryptionSpec)
if chunkErr != nil {
return nil, fmt.Errorf("create chunk from data: %w", chunkErr)
}
diff --git a/weed/s3api/s3api_test.go b/weed/s3api/s3api_test.go
index 80dced5999..106c667980 100644
--- a/weed/s3api/s3api_test.go
+++ b/weed/s3api/s3api_test.go
@@ -1,9 +1,10 @@
package s3api
import (
- "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
"testing"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
)
func TestCopyObjectResponse(t *testing.T) {
diff --git a/weed/s3api/s3api_version_id_test.go b/weed/s3api/s3api_version_id_test.go
index 5c612ac586..fd52fd7737 100644
--- a/weed/s3api/s3api_version_id_test.go
+++ b/weed/s3api/s3api_version_id_test.go
@@ -372,4 +372,3 @@ func TestMixedFormatTransition(t *testing.T) {
t.Errorf("compareVersionIds(newest_new_format, oldest_old_format) = %d, want negative", result)
}
}
-
diff --git a/weed/s3api/s3bucket/s3api_bucket_test.go b/weed/s3api/s3bucket/s3api_bucket_test.go
index 9ada225eff..b81ace85ec 100644
--- a/weed/s3api/s3bucket/s3api_bucket_test.go
+++ b/weed/s3api/s3bucket/s3api_bucket_test.go
@@ -1,8 +1,9 @@
package s3bucket
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func Test_verifyBucketName(t *testing.T) {
diff --git a/weed/sequence/snowflake_sequencer_test.go b/weed/sequence/snowflake_sequencer_test.go
index 7e8c1d0469..dd21931881 100644
--- a/weed/sequence/snowflake_sequencer_test.go
+++ b/weed/sequence/snowflake_sequencer_test.go
@@ -2,9 +2,10 @@ package sequence
import (
"encoding/hex"
+ "testing"
+
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/stretchr/testify/assert"
- "testing"
)
func TestSequencer(t *testing.T) {
diff --git a/weed/server/filer_grpc_server_admin.go b/weed/server/filer_grpc_server_admin.go
index 92a820f35f..914fca56ce 100644
--- a/weed/server/filer_grpc_server_admin.go
+++ b/weed/server/filer_grpc_server_admin.go
@@ -3,7 +3,6 @@ package weed_server
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"time"
"github.com/seaweedfs/seaweedfs/weed/cluster"
@@ -12,6 +11,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
func (fs *FilerServer) Statistics(ctx context.Context, req *filer_pb.StatisticsRequest) (resp *filer_pb.StatisticsResponse, err error) {
diff --git a/weed/server/filer_grpc_server_kv.go b/weed/server/filer_grpc_server_kv.go
index be90b20143..267f408a54 100644
--- a/weed/server/filer_grpc_server_kv.go
+++ b/weed/server/filer_grpc_server_kv.go
@@ -2,6 +2,7 @@ package weed_server
import (
"context"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
diff --git a/weed/server/filer_grpc_server_traverse_meta_test.go b/weed/server/filer_grpc_server_traverse_meta_test.go
index 72f8a916ea..31cd330649 100644
--- a/weed/server/filer_grpc_server_traverse_meta_test.go
+++ b/weed/server/filer_grpc_server_traverse_meta_test.go
@@ -1,9 +1,10 @@
package weed_server
import (
+ "testing"
+
"github.com/stretchr/testify/assert"
"github.com/viant/ptrie"
- "testing"
)
func TestPtrie(t *testing.T) {
diff --git a/weed/server/filer_server_handlers.go b/weed/server/filer_server_handlers.go
index f068579ecb..57d6757400 100644
--- a/weed/server/filer_server_handlers.go
+++ b/weed/server/filer_server_handlers.go
@@ -3,7 +3,6 @@ package weed_server
import (
"context"
"errors"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"net/http"
"os"
"strconv"
@@ -16,6 +15,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/stats"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
@@ -99,10 +99,10 @@ func (fs *FilerServer) filerHandler(w http.ResponseWriter, r *http.Request) {
// Wait if either data size limit or file count limit is exceeded
for (fs.option.ConcurrentUploadLimit != 0 && inFlightDataSize > fs.option.ConcurrentUploadLimit) || (fs.option.ConcurrentFileUploadLimit != 0 && inFlightUploads >= fs.option.ConcurrentFileUploadLimit) {
- if (fs.option.ConcurrentUploadLimit != 0 && inFlightDataSize > fs.option.ConcurrentUploadLimit) {
+ if fs.option.ConcurrentUploadLimit != 0 && inFlightDataSize > fs.option.ConcurrentUploadLimit {
glog.V(4).Infof("wait because inflight data %d > %d", inFlightDataSize, fs.option.ConcurrentUploadLimit)
}
- if (fs.option.ConcurrentFileUploadLimit != 0 && inFlightUploads >= fs.option.ConcurrentFileUploadLimit) {
+ if fs.option.ConcurrentFileUploadLimit != 0 && inFlightUploads >= fs.option.ConcurrentFileUploadLimit {
glog.V(4).Infof("wait because inflight uploads %d >= %d", inFlightUploads, fs.option.ConcurrentFileUploadLimit)
}
fs.inFlightDataLimitCond.Wait()
diff --git a/weed/server/filer_server_handlers_read_dir.go b/weed/server/filer_server_handlers_read_dir.go
index 9266cb5368..380816a4de 100644
--- a/weed/server/filer_server_handlers_read_dir.go
+++ b/weed/server/filer_server_handlers_read_dir.go
@@ -2,7 +2,6 @@ package weed_server
import (
"errors"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"net/http"
"strconv"
"strings"
@@ -11,6 +10,7 @@ import (
ui "github.com/seaweedfs/seaweedfs/weed/server/filer_ui"
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/util"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
// listDirectoryHandler lists directories and folders under a directory
diff --git a/weed/server/filer_ui/templates.go b/weed/server/filer_ui/templates.go
index f9ef064bc3..7faf01007d 100644
--- a/weed/server/filer_ui/templates.go
+++ b/weed/server/filer_ui/templates.go
@@ -2,10 +2,11 @@ package filer_ui
import (
_ "embed"
- "github.com/dustin/go-humanize"
"html/template"
"net/url"
"strings"
+
+ "github.com/dustin/go-humanize"
)
func printpath(parts ...string) string {
diff --git a/weed/server/master_grpc_server_admin.go b/weed/server/master_grpc_server_admin.go
index d8b63b5da9..eb6cb452bc 100644
--- a/weed/server/master_grpc_server_admin.go
+++ b/weed/server/master_grpc_server_admin.go
@@ -3,7 +3,6 @@ package weed_server
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/stats"
"math/rand/v2"
"sync"
"time"
@@ -13,9 +12,9 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
- "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
-
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
+ "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
+ "github.com/seaweedfs/seaweedfs/weed/stats"
)
/*
diff --git a/weed/server/master_grpc_server_cluster.go b/weed/server/master_grpc_server_cluster.go
index 5c99fd00da..036dd8971b 100644
--- a/weed/server/master_grpc_server_cluster.go
+++ b/weed/server/master_grpc_server_cluster.go
@@ -2,10 +2,11 @@ package weed_server
import (
"context"
+ "math/rand/v2"
+
"github.com/seaweedfs/seaweedfs/weed/cluster"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
- "math/rand/v2"
)
func (ms *MasterServer) ListClusterNodes(ctx context.Context, req *master_pb.ListClusterNodesRequest) (*master_pb.ListClusterNodesResponse, error) {
diff --git a/weed/server/raft_server_handlers.go b/weed/server/raft_server_handlers.go
index eba61569eb..45a63b9e46 100644
--- a/weed/server/raft_server_handlers.go
+++ b/weed/server/raft_server_handlers.go
@@ -1,12 +1,13 @@
package weed_server
import (
+ "net/http"
+ "time"
+
"github.com/cenkalti/backoff/v4"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
- "net/http"
- "time"
)
type ClusterStatusResult struct {
diff --git a/weed/server/volume_grpc_copy.go b/weed/server/volume_grpc_copy.go
index c48f3edf24..92f1edcb04 100644
--- a/weed/server/volume_grpc_copy.go
+++ b/weed/server/volume_grpc_copy.go
@@ -428,10 +428,10 @@ func (vs *VolumeServer) CopyFile(req *volume_server_pb.CopyFileRequest, stream v
}
-// If no data has been sent in the loop (e.g. for an empty file, or when stopOffset is 0),
-// we still need to send the ModifiedTsNs so the client knows the source file exists.
-// fileModTsNs is set to 0 after the first send, so if it's still non-zero,
-// we haven't sent anything yet.
+ // If no data has been sent in the loop (e.g. for an empty file, or when stopOffset is 0),
+ // we still need to send the ModifiedTsNs so the client knows the source file exists.
+ // fileModTsNs is set to 0 after the first send, so if it's still non-zero,
+ // we haven't sent anything yet.
if fileModTsNs != 0 {
err = stream.Send(&volume_server_pb.CopyFileResponse{
ModifiedTsNs: fileModTsNs,
diff --git a/weed/server/volume_grpc_read_all.go b/weed/server/volume_grpc_read_all.go
index 68001ce9e2..0b1aff2ff7 100644
--- a/weed/server/volume_grpc_read_all.go
+++ b/weed/server/volume_grpc_read_all.go
@@ -2,6 +2,7 @@ package weed_server
import (
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
diff --git a/weed/server/volume_grpc_read_write.go b/weed/server/volume_grpc_read_write.go
index eadefc4099..1c0ddf5dd5 100644
--- a/weed/server/volume_grpc_read_write.go
+++ b/weed/server/volume_grpc_read_write.go
@@ -3,6 +3,7 @@ package weed_server
import (
"context"
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
diff --git a/weed/server/volume_grpc_remote.go b/weed/server/volume_grpc_remote.go
index 669858b6a1..0dffb49cf7 100644
--- a/weed/server/volume_grpc_remote.go
+++ b/weed/server/volume_grpc_remote.go
@@ -3,14 +3,15 @@ package weed_server
import (
"context"
"fmt"
+ "sync"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/security"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
- "sync"
- "time"
)
func (vs *VolumeServer) FetchAndWriteNeedle(ctx context.Context, req *volume_server_pb.FetchAndWriteNeedleRequest) (resp *volume_server_pb.FetchAndWriteNeedleResponse, err error) {
diff --git a/weed/server/wrapped_webdav_fs.go b/weed/server/wrapped_webdav_fs.go
index f110d41a49..4ef8d4e68c 100644
--- a/weed/server/wrapped_webdav_fs.go
+++ b/weed/server/wrapped_webdav_fs.go
@@ -2,10 +2,11 @@ package weed_server
import (
"context"
- "golang.org/x/net/webdav"
"io/fs"
"os"
"strings"
+
+ "golang.org/x/net/webdav"
)
type wrappedFs struct {
diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go
index 57b30e0088..4a1460e27c 100644
--- a/weed/shell/command_cluster_check.go
+++ b/weed/shell/command_cluster_check.go
@@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/storage/types"
"io"
"github.com/seaweedfs/seaweedfs/weed/cluster"
@@ -12,6 +11,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
+ "github.com/seaweedfs/seaweedfs/weed/storage/types"
)
func init() {
diff --git a/weed/shell/command_cluster_ps.go b/weed/shell/command_cluster_ps.go
index 5a15036125..0f9e8e5ec8 100644
--- a/weed/shell/command_cluster_ps.go
+++ b/weed/shell/command_cluster_ps.go
@@ -4,14 +4,15 @@ import (
"context"
"flag"
"fmt"
+ "io"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/cluster"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
- "io"
- "time"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
diff --git a/weed/shell/command_cluster_raft_add.go b/weed/shell/command_cluster_raft_add.go
index eb75f8b158..a957d7c44f 100644
--- a/weed/shell/command_cluster_raft_add.go
+++ b/weed/shell/command_cluster_raft_add.go
@@ -4,8 +4,9 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"io"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
func init() {
diff --git a/weed/shell/command_cluster_raft_leader_transfer.go b/weed/shell/command_cluster_raft_leader_transfer.go
index a8bef4a2eb..32dc83f515 100644
--- a/weed/shell/command_cluster_raft_leader_transfer.go
+++ b/weed/shell/command_cluster_raft_leader_transfer.go
@@ -141,4 +141,3 @@ func (c *commandRaftLeaderTransfer) Do(args []string, commandEnv *CommandEnv, wr
return nil
}
-
diff --git a/weed/shell/command_cluster_raft_leader_transfer_test.go b/weed/shell/command_cluster_raft_leader_transfer_test.go
index 8280489f76..7858abb342 100644
--- a/weed/shell/command_cluster_raft_leader_transfer_test.go
+++ b/weed/shell/command_cluster_raft_leader_transfer_test.go
@@ -86,4 +86,3 @@ func TestRaftLeaderTransfer_UnknownFlag(t *testing.T) {
t.Error("expected error for unknown flag")
}
}
-
diff --git a/weed/shell/command_cluster_raft_ps.go b/weed/shell/command_cluster_raft_ps.go
index 73bfde8da5..714e176497 100644
--- a/weed/shell/command_cluster_raft_ps.go
+++ b/weed/shell/command_cluster_raft_ps.go
@@ -4,8 +4,9 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"io"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
func init() {
diff --git a/weed/shell/command_cluster_raft_remove.go b/weed/shell/command_cluster_raft_remove.go
index c9ada8bcd5..6f53247319 100644
--- a/weed/shell/command_cluster_raft_remove.go
+++ b/weed/shell/command_cluster_raft_remove.go
@@ -4,8 +4,9 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"io"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
func init() {
diff --git a/weed/shell/command_collection_list.go b/weed/shell/command_collection_list.go
index 32085f565b..582ea54ca7 100644
--- a/weed/shell/command_collection_list.go
+++ b/weed/shell/command_collection_list.go
@@ -3,9 +3,10 @@ package shell
import (
"context"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
- "io"
)
func init() {
diff --git a/weed/shell/command_fs_log.go b/weed/shell/command_fs_log.go
index 66f143030e..b93c2b9cdf 100644
--- a/weed/shell/command_fs_log.go
+++ b/weed/shell/command_fs_log.go
@@ -4,10 +4,11 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/filer"
- "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"io"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/filer"
+ "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
func init() {
diff --git a/weed/shell/command_fs_verify.go b/weed/shell/command_fs_verify.go
index fd46bf5911..78f1544056 100644
--- a/weed/shell/command_fs_verify.go
+++ b/weed/shell/command_fs_verify.go
@@ -11,6 +11,8 @@ import (
"sync"
"time"
+ "slices"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb"
@@ -20,7 +22,6 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/util"
"go.uber.org/atomic"
- "slices"
)
func init() {
diff --git a/weed/shell/command_lock_unlock.go b/weed/shell/command_lock_unlock.go
index 79f3c95b1d..982bb91203 100644
--- a/weed/shell/command_lock_unlock.go
+++ b/weed/shell/command_lock_unlock.go
@@ -1,8 +1,9 @@
package shell
import (
- "github.com/seaweedfs/seaweedfs/weed/util"
"io"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
func init() {
diff --git a/weed/shell/command_mq_balance.go b/weed/shell/command_mq_balance.go
index 2e61e640c6..a9576838e5 100644
--- a/weed/shell/command_mq_balance.go
+++ b/weed/shell/command_mq_balance.go
@@ -3,9 +3,10 @@ package shell
import (
"context"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
- "io"
)
func init() {
diff --git a/weed/shell/command_mq_topic_configure.go b/weed/shell/command_mq_topic_configure.go
index ab54ee5541..ea58d57876 100644
--- a/weed/shell/command_mq_topic_configure.go
+++ b/weed/shell/command_mq_topic_configure.go
@@ -5,10 +5,11 @@ import (
"encoding/json"
"flag"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
- "io"
)
func init() {
diff --git a/weed/shell/command_mq_topic_desc.go b/weed/shell/command_mq_topic_desc.go
index 9a0d61066b..b1b9766496 100644
--- a/weed/shell/command_mq_topic_desc.go
+++ b/weed/shell/command_mq_topic_desc.go
@@ -4,10 +4,11 @@ import (
"context"
"flag"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"
- "io"
)
func init() {
diff --git a/weed/shell/command_mq_topic_list.go b/weed/shell/command_mq_topic_list.go
index d8d7a08cb7..8bed7c5602 100644
--- a/weed/shell/command_mq_topic_list.go
+++ b/weed/shell/command_mq_topic_list.go
@@ -3,11 +3,12 @@ package shell
import (
"context"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"
- "io"
)
func init() {
diff --git a/weed/shell/command_remote_meta_sync.go b/weed/shell/command_remote_meta_sync.go
index d42aaef954..d71ba16084 100644
--- a/weed/shell/command_remote_meta_sync.go
+++ b/weed/shell/command_remote_meta_sync.go
@@ -4,12 +4,13 @@ import (
"context"
"flag"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "io"
)
func init() {
diff --git a/weed/shell/command_remote_mount.go b/weed/shell/command_remote_mount.go
index 59ab75b4d2..144aa079ae 100644
--- a/weed/shell/command_remote_mount.go
+++ b/weed/shell/command_remote_mount.go
@@ -4,16 +4,17 @@ import (
"context"
"flag"
"fmt"
+ "io"
+ "os"
+ "strings"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
"google.golang.org/protobuf/proto"
- "io"
- "os"
- "strings"
- "time"
)
func init() {
diff --git a/weed/shell/command_remote_mount_buckets.go b/weed/shell/command_remote_mount_buckets.go
index 6176aa3d77..77aa1ba303 100644
--- a/weed/shell/command_remote_mount_buckets.go
+++ b/weed/shell/command_remote_mount_buckets.go
@@ -3,13 +3,14 @@ package shell
import (
"flag"
"fmt"
+ "io"
+ "path/filepath"
+ "regexp"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/remote_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "io"
- "path/filepath"
- "regexp"
)
func init() {
diff --git a/weed/shell/command_remote_unmount.go b/weed/shell/command_remote_unmount.go
index 2e1ba393c9..bb70744c69 100644
--- a/weed/shell/command_remote_unmount.go
+++ b/weed/shell/command_remote_unmount.go
@@ -4,12 +4,13 @@ import (
"context"
"flag"
"fmt"
+ "io"
+ "time"
+
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/remote_storage"
"github.com/seaweedfs/seaweedfs/weed/util"
- "io"
- "time"
)
func init() {
diff --git a/weed/shell/command_volume_copy.go b/weed/shell/command_volume_copy.go
index 5c7cc33b00..3156be8b5f 100644
--- a/weed/shell/command_volume_copy.go
+++ b/weed/shell/command_volume_copy.go
@@ -3,9 +3,9 @@ package shell
import (
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"io"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
)
diff --git a/weed/shell/command_volume_delete.go b/weed/shell/command_volume_delete.go
index 719420bcc9..a7d52c0116 100644
--- a/weed/shell/command_volume_delete.go
+++ b/weed/shell/command_volume_delete.go
@@ -2,9 +2,9 @@ package shell
import (
"flag"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"io"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
)
diff --git a/weed/shell/command_volume_grow.go b/weed/shell/command_volume_grow.go
index 5b351e6ab3..1a9a043d72 100644
--- a/weed/shell/command_volume_grow.go
+++ b/weed/shell/command_volume_grow.go
@@ -4,11 +4,12 @@ import (
"context"
"flag"
"fmt"
+ "io"
+
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
- "io"
)
func init() {
diff --git a/weed/shell/command_volume_mount.go b/weed/shell/command_volume_mount.go
index 0b62905de3..121d2bbdc5 100644
--- a/weed/shell/command_volume_mount.go
+++ b/weed/shell/command_volume_mount.go
@@ -3,10 +3,10 @@ package shell
import (
"context"
"flag"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"io"
"github.com/seaweedfs/seaweedfs/weed/operation"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"google.golang.org/grpc"
diff --git a/weed/shell/command_volume_replica_check_test.go b/weed/shell/command_volume_replica_check_test.go
index 7629ea8623..fde9d22f7c 100644
--- a/weed/shell/command_volume_replica_check_test.go
+++ b/weed/shell/command_volume_replica_check_test.go
@@ -270,4 +270,3 @@ func TestAvoidDuplicateCopies(t *testing.T) {
t.Errorf("Expected 5 entries in union, got %d", count)
}
}
-
diff --git a/weed/shell/command_volume_unmount.go b/weed/shell/command_volume_unmount.go
index ccb83bbaeb..ee273ed081 100644
--- a/weed/shell/command_volume_unmount.go
+++ b/weed/shell/command_volume_unmount.go
@@ -4,10 +4,10 @@ import (
"context"
"flag"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
"io"
"github.com/seaweedfs/seaweedfs/weed/operation"
+ "github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"google.golang.org/grpc"
diff --git a/weed/stats/disk_windows.go b/weed/stats/disk_windows.go
index 93c703134c..c3bf04eab9 100644
--- a/weed/stats/disk_windows.go
+++ b/weed/stats/disk_windows.go
@@ -1,10 +1,11 @@
package stats
import (
- "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
- "golang.org/x/sys/windows"
"syscall"
"unsafe"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
+ "golang.org/x/sys/windows"
)
var (
diff --git a/weed/stats/metrics_buildinfo_test.go b/weed/stats/metrics_buildinfo_test.go
index 1fc4a2b523..43c6439d35 100644
--- a/weed/stats/metrics_buildinfo_test.go
+++ b/weed/stats/metrics_buildinfo_test.go
@@ -29,7 +29,7 @@ func TestBuildInfo(t *testing.T) {
if mf.GetName() == "SeaweedFS_build_info" {
found = true
metric := mf.GetMetric()[0]
-
+
// Verify the metric value is 1
if metric.GetGauge().GetValue() != 1 {
t.Errorf("Expected BuildInfo value to be 1, got %f", metric.GetGauge().GetValue())
@@ -79,4 +79,3 @@ func TestBuildInfo(t *testing.T) {
t.Error("BuildInfo metric not found in gathered metrics")
}
}
-
diff --git a/weed/storage/backend/backend.go b/weed/storage/backend/backend.go
index c17bec822a..539867f8f6 100644
--- a/weed/storage/backend/backend.go
+++ b/weed/storage/backend/backend.go
@@ -1,7 +1,6 @@
package backend
import (
- "github.com/seaweedfs/seaweedfs/weed/util"
"io"
"os"
"strings"
@@ -10,6 +9,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
type BackendStorageFile interface {
diff --git a/weed/storage/backend/disk_file.go b/weed/storage/backend/disk_file.go
index 070f79865b..1573f8467f 100644
--- a/weed/storage/backend/disk_file.go
+++ b/weed/storage/backend/disk_file.go
@@ -1,12 +1,13 @@
package backend
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
- . "github.com/seaweedfs/seaweedfs/weed/storage/types"
"io"
"os"
"runtime"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+ . "github.com/seaweedfs/seaweedfs/weed/storage/types"
)
var (
diff --git a/weed/storage/backend/memory_map/os_overloads/file_windows.go b/weed/storage/backend/memory_map/os_overloads/file_windows.go
index 05aa384e29..93467303d4 100644
--- a/weed/storage/backend/memory_map/os_overloads/file_windows.go
+++ b/weed/storage/backend/memory_map/os_overloads/file_windows.go
@@ -157,7 +157,7 @@ func syscallMode(i os.FileMode) (o uint32) {
return
}
-//If the bool is set to true then the file is opened with the parameters FILE_ATTRIBUTE_TEMPORARY and
+// If the bool is set to true then the file is opened with the parameters FILE_ATTRIBUTE_TEMPORARY and
// FILE_FLAG_DELETE_ON_CLOSE
func OpenFile(name string, flag int, perm os.FileMode, setToTempAndDelete bool) (file *os.File, err error) {
r, e := Open(fixLongPath(name), flag|windows.O_CLOEXEC, syscallMode(perm), setToTempAndDelete)
diff --git a/weed/storage/backend/rclone_backend/rclone_backend.go b/weed/storage/backend/rclone_backend/rclone_backend.go
index e47c2f908d..c954c0b73d 100644
--- a/weed/storage/backend/rclone_backend/rclone_backend.go
+++ b/weed/storage/backend/rclone_backend/rclone_backend.go
@@ -7,23 +7,21 @@ import (
"bytes"
"context"
"fmt"
- "github.com/rclone/rclone/fs/config/configfile"
- "github.com/seaweedfs/seaweedfs/weed/util"
"io"
"os"
"text/template"
"time"
"github.com/google/uuid"
-
_ "github.com/rclone/rclone/backend/all"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/accounting"
+ "github.com/rclone/rclone/fs/config/configfile"
"github.com/rclone/rclone/fs/object"
-
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
func init() {
diff --git a/weed/storage/backend/s3_backend/s3_sessions.go b/weed/storage/backend/s3_backend/s3_sessions.go
index dfb0aa564f..b5ae489716 100644
--- a/weed/storage/backend/s3_backend/s3_sessions.go
+++ b/weed/storage/backend/s3_backend/s3_sessions.go
@@ -2,7 +2,6 @@ package s3_backend
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"sync"
"github.com/aws/aws-sdk-go/aws"
@@ -11,6 +10,7 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
)
var (
diff --git a/weed/storage/backend/s3_backend/s3_upload.go b/weed/storage/backend/s3_backend/s3_upload.go
index 537e6bd1d5..1392ad23a2 100644
--- a/weed/storage/backend/s3_backend/s3_upload.go
+++ b/weed/storage/backend/s3_backend/s3_upload.go
@@ -2,11 +2,12 @@ package s3_backend
import (
"fmt"
+ "os"
+ "sync"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
- "os"
- "sync"
"github.com/seaweedfs/seaweedfs/weed/glog"
)
diff --git a/weed/storage/disk_location_test.go b/weed/storage/disk_location_test.go
index d2823588f9..f60a61475d 100644
--- a/weed/storage/disk_location_test.go
+++ b/weed/storage/disk_location_test.go
@@ -1,12 +1,12 @@
package storage
import (
- "github.com/seaweedfs/seaweedfs/weed/storage/types"
"testing"
"time"
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
+ "github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/storage/erasure_coding/distribution/analysis.go b/weed/storage/erasure_coding/distribution/analysis.go
index 6b1f800537..22923e6715 100644
--- a/weed/storage/erasure_coding/distribution/analysis.go
+++ b/weed/storage/erasure_coding/distribution/analysis.go
@@ -15,12 +15,12 @@ type ShardLocation struct {
// TopologyNode represents a node in the topology that can hold EC shards
type TopologyNode struct {
- NodeID string
- DataCenter string
- Rack string
- FreeSlots int // Available slots for new shards
- ShardIDs []int // Shard IDs currently on this node for a specific volume
- TotalShards int // Total shards on this node (for all volumes)
+ NodeID string
+ DataCenter string
+ Rack string
+ FreeSlots int // Available slots for new shards
+ ShardIDs []int // Shard IDs currently on this node for a specific volume
+ TotalShards int // Total shards on this node (for all volumes)
}
// TopologyAnalysis holds the current shard distribution analysis for a volume
@@ -36,9 +36,9 @@ type TopologyAnalysis struct {
NodeToShards map[string][]int // NodeID -> list of shard IDs
// Topology structure
- DCToRacks map[string][]string // DC -> list of rack IDs
- RackToNodes map[string][]*TopologyNode // Rack -> list of nodes
- AllNodes map[string]*TopologyNode // NodeID -> node info
+ DCToRacks map[string][]string // DC -> list of rack IDs
+ RackToNodes map[string][]*TopologyNode // Rack -> list of nodes
+ AllNodes map[string]*TopologyNode // NodeID -> node info
// Statistics
TotalShards int
@@ -144,11 +144,11 @@ func (a *TopologyAnalysis) DetailedString() string {
// TopologyExcess represents a topology level (DC/rack/node) with excess shards
type TopologyExcess struct {
- ID string // DC/rack/node ID
- Level string // "dc", "rack", or "node"
- Excess int // Number of excess shards (above target)
- Shards []int // Shard IDs at this level
- Nodes []*TopologyNode // Nodes at this level (for finding sources)
+ ID string // DC/rack/node ID
+ Level string // "dc", "rack", or "node"
+ Excess int // Number of excess shards (above target)
+ Shards []int // Shard IDs at this level
+ Nodes []*TopologyNode // Nodes at this level (for finding sources)
}
// CalculateDCExcess returns DCs with more shards than the target
@@ -238,4 +238,3 @@ func CalculateUnderservedRacks(analysis *TopologyAnalysis, dc string, targetPerR
return underserved
}
-
diff --git a/weed/storage/erasure_coding/distribution/distribution.go b/weed/storage/erasure_coding/distribution/distribution.go
index a49f10a1e5..03deea710d 100644
--- a/weed/storage/erasure_coding/distribution/distribution.go
+++ b/weed/storage/erasure_coding/distribution/distribution.go
@@ -158,4 +158,3 @@ func ceilDivide(a, b int) int {
}
return (a + b - 1) / b
}
-
diff --git a/weed/storage/erasure_coding/distribution/rebalancer.go b/weed/storage/erasure_coding/distribution/rebalancer.go
index 17fc41b237..cd8b87de6d 100644
--- a/weed/storage/erasure_coding/distribution/rebalancer.go
+++ b/weed/storage/erasure_coding/distribution/rebalancer.go
@@ -26,8 +26,8 @@ type RebalancePlan struct {
Analysis *TopologyAnalysis
// Statistics
- TotalMoves int
- MovesAcrossDC int
+ TotalMoves int
+ MovesAcrossDC int
MovesAcrossRack int
MovesWithinRack int
}
@@ -54,8 +54,8 @@ func (p *RebalancePlan) DetailedString() string {
// Rebalancer plans shard moves to achieve proportional distribution
type Rebalancer struct {
- ecConfig ECConfig
- repConfig ReplicationConfig
+ ecConfig ECConfig
+ repConfig ReplicationConfig
}
// NewRebalancer creates a new rebalancer with the given configuration
@@ -375,4 +375,3 @@ func (r *Rebalancer) applyMovesToAnalysis(analysis *TopologyAnalysis, moves []Sh
// Counts are already updated by the individual planners.
// This function is kept for API compatibility and potential future use.
}
-
diff --git a/weed/storage/erasure_coding/ec_test.go b/weed/storage/erasure_coding/ec_test.go
index cbb20832cc..0930d1b01a 100644
--- a/weed/storage/erasure_coding/ec_test.go
+++ b/weed/storage/erasure_coding/ec_test.go
@@ -3,11 +3,12 @@ package erasure_coding
import (
"bytes"
"fmt"
- "github.com/stretchr/testify/assert"
"math/rand"
"os"
"testing"
+ "github.com/stretchr/testify/assert"
+
"github.com/klauspost/reedsolomon"
"github.com/seaweedfs/seaweedfs/weed/storage/needle_map"
diff --git a/weed/storage/erasure_coding/placement/placement_test.go b/weed/storage/erasure_coding/placement/placement_test.go
index 6cb94a4daa..7501dfa9e8 100644
--- a/weed/storage/erasure_coding/placement/placement_test.go
+++ b/weed/storage/erasure_coding/placement/placement_test.go
@@ -1,7 +1,7 @@
package placement
import (
-"testing"
+ "testing"
)
// Helper function to create disk candidates for testing
@@ -402,19 +402,19 @@ func TestCalculateIdealDistribution(t *testing.T) {
expectedMin int
expectedMax int
}{
- {14, 7, 2, 2}, // Even distribution
- {14, 4, 3, 4}, // Uneven: 14/4 = 3 remainder 2
- {6, 3, 2, 2}, // Even distribution
- {7, 3, 2, 3}, // Uneven: 7/3 = 2 remainder 1
- {10, 0, 0, 10}, // Edge case: no servers
- {0, 5, 0, 0}, // Edge case: no shards
+ {14, 7, 2, 2}, // Even distribution
+ {14, 4, 3, 4}, // Uneven: 14/4 = 3 remainder 2
+ {6, 3, 2, 2}, // Even distribution
+ {7, 3, 2, 3}, // Uneven: 7/3 = 2 remainder 1
+ {10, 0, 0, 10}, // Edge case: no servers
+ {0, 5, 0, 0}, // Edge case: no shards
}
for _, tt := range tests {
min, max := CalculateIdealDistribution(tt.totalShards, tt.numServers)
if min != tt.expectedMin || max != tt.expectedMax {
t.Errorf("CalculateIdealDistribution(%d, %d) = (%d, %d), want (%d, %d)",
-tt.totalShards, tt.numServers, min, max, tt.expectedMin, tt.expectedMax)
+ tt.totalShards, tt.numServers, min, max, tt.expectedMin, tt.expectedMax)
}
}
}
diff --git a/weed/storage/needle/file_id_test.go b/weed/storage/needle/file_id_test.go
index 2796470aa7..191c4aa96d 100644
--- a/weed/storage/needle/file_id_test.go
+++ b/weed/storage/needle/file_id_test.go
@@ -1,8 +1,9 @@
package needle
import (
- "github.com/seaweedfs/seaweedfs/weed/storage/types"
"testing"
+
+ "github.com/seaweedfs/seaweedfs/weed/storage/types"
)
func TestParseFileIdFromString(t *testing.T) {
diff --git a/weed/storage/types/needle_id_type.go b/weed/storage/types/needle_id_type.go
index 1ea9b0a1aa..a927b6e3ca 100644
--- a/weed/storage/types/needle_id_type.go
+++ b/weed/storage/types/needle_id_type.go
@@ -2,8 +2,9 @@ package types
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util"
"strconv"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
)
type NeedleId uint64
diff --git a/weed/storage/volume_checking.go b/weed/storage/volume_checking.go
index 6f21c7dcd5..7ac63d6f0b 100644
--- a/weed/storage/volume_checking.go
+++ b/weed/storage/volume_checking.go
@@ -2,7 +2,6 @@ package storage
import (
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"io"
"os"
@@ -10,6 +9,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
"github.com/seaweedfs/seaweedfs/weed/storage/idx"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
+ "github.com/seaweedfs/seaweedfs/weed/storage/super_block"
. "github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/seaweedfs/seaweedfs/weed/util"
)
diff --git a/weed/storage/volume_info/volume_info.go b/weed/storage/volume_info/volume_info.go
index 75cbc1472d..19b1d336e1 100644
--- a/weed/storage/volume_info/volume_info.go
+++ b/weed/storage/volume_info/volume_info.go
@@ -2,7 +2,6 @@ package volume_info
import (
"fmt"
- jsonpb "google.golang.org/protobuf/encoding/protojson"
"os"
"github.com/seaweedfs/seaweedfs/weed/glog"
@@ -10,6 +9,7 @@ import (
_ "github.com/seaweedfs/seaweedfs/weed/storage/backend/rclone_backend"
_ "github.com/seaweedfs/seaweedfs/weed/storage/backend/s3_backend"
"github.com/seaweedfs/seaweedfs/weed/util"
+ jsonpb "google.golang.org/protobuf/encoding/protojson"
)
// MaybeLoadVolumeInfo load the file data as *volume_server_pb.VolumeInfo, the returned volumeInfo will not be nil
diff --git a/weed/topology/cluster_commands.go b/weed/topology/cluster_commands.go
index 2546702e5f..3e4b446482 100644
--- a/weed/topology/cluster_commands.go
+++ b/weed/topology/cluster_commands.go
@@ -3,6 +3,7 @@ package topology
import (
"encoding/json"
"fmt"
+
hashicorpRaft "github.com/hashicorp/raft"
"github.com/seaweedfs/raft"
"github.com/seaweedfs/seaweedfs/weed/glog"
diff --git a/weed/topology/collection.go b/weed/topology/collection.go
index e197ce1a2b..69538a495e 100644
--- a/weed/topology/collection.go
+++ b/weed/topology/collection.go
@@ -2,6 +2,7 @@ package topology
import (
"fmt"
+
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.go
index c6386eeb75..d6c774d318 100644
--- a/weed/topology/store_replicate.go
+++ b/weed/topology/store_replicate.go
@@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
- "google.golang.org/grpc"
"net/http"
"net/url"
"strconv"
@@ -22,6 +21,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/buffer_pool"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
+ "google.golang.org/grpc"
)
func ReplicatedWrite(ctx context.Context, masterFn operation.GetMasterFn, grpcDialOption grpc.DialOption, s *storage.Store, volumeId needle.VolumeId, n *needle.Needle, r *http.Request, contentMd5 string) (isUnchanged bool, err error) {
diff --git a/weed/topology/topology_info.go b/weed/topology/topology_info.go
index 9c0a14991e..5749f86699 100644
--- a/weed/topology/topology_info.go
+++ b/weed/topology/topology_info.go
@@ -1,9 +1,10 @@
package topology
import (
- "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"slices"
"strings"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
)
type TopologyInfo struct {
diff --git a/weed/util/chunk_cache/chunk_cache_in_memory.go b/weed/util/chunk_cache/chunk_cache_in_memory.go
index dd101996e9..0f35225f52 100644
--- a/weed/util/chunk_cache/chunk_cache_in_memory.go
+++ b/weed/util/chunk_cache/chunk_cache_in_memory.go
@@ -1,8 +1,9 @@
package chunk_cache
import (
- "github.com/karlseguin/ccache/v2"
"time"
+
+ "github.com/karlseguin/ccache/v2"
)
var (
diff --git a/weed/util/chunk_cache/on_disk_cache_layer.go b/weed/util/chunk_cache/on_disk_cache_layer.go
index fdbaef7c24..3258428e14 100644
--- a/weed/util/chunk_cache/on_disk_cache_layer.go
+++ b/weed/util/chunk_cache/on_disk_cache_layer.go
@@ -2,11 +2,12 @@ package chunk_cache
import (
"fmt"
+ "path"
+ "slices"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
- "path"
- "slices"
)
type OnDiskCacheLayer struct {
diff --git a/weed/util/file_util.go b/weed/util/file_util.go
index 430b6bc86e..6c5f33a244 100644
--- a/weed/util/file_util.go
+++ b/weed/util/file_util.go
@@ -5,12 +5,13 @@ import (
"crypto/sha256"
"errors"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"os"
"os/user"
"path/filepath"
"strings"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
)
const maxFilenameLength = 255
diff --git a/weed/util/grace/signal_handling.go b/weed/util/grace/signal_handling.go
index 0fc0f43e18..a661f939ca 100644
--- a/weed/util/grace/signal_handling.go
+++ b/weed/util/grace/signal_handling.go
@@ -4,13 +4,14 @@
package grace
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
"os"
"os/signal"
"reflect"
"runtime"
"sync"
"syscall"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
)
var signalChan chan os.Signal
diff --git a/weed/util/http/client/http_client.go b/weed/util/http/client/http_client.go
index d1d2f5c560..661df582e3 100644
--- a/weed/util/http/client/http_client.go
+++ b/weed/util/http/client/http_client.go
@@ -4,14 +4,15 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
- util "github.com/seaweedfs/seaweedfs/weed/util"
- "github.com/spf13/viper"
"io"
"net/http"
"net/url"
"os"
"strings"
"sync"
+
+ util "github.com/seaweedfs/seaweedfs/weed/util"
+ "github.com/spf13/viper"
)
var (
diff --git a/weed/util/inits_test.go b/weed/util/inits_test.go
index f2c9b701fc..3334d012a7 100644
--- a/weed/util/inits_test.go
+++ b/weed/util/inits_test.go
@@ -1,8 +1,9 @@
package util
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func TestHumanReadableIntsMax(t *testing.T) {
diff --git a/weed/util/limited_async_pool_test.go b/weed/util/limited_async_pool_test.go
index 090ce5375a..1289f4f337 100644
--- a/weed/util/limited_async_pool_test.go
+++ b/weed/util/limited_async_pool_test.go
@@ -2,10 +2,11 @@ package util
import (
"fmt"
- "github.com/stretchr/testify/assert"
"sort"
"testing"
"time"
+
+ "github.com/stretchr/testify/assert"
)
func TestAsyncPool(t *testing.T) {
diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go
index e47034d879..dfc91cb258 100644
--- a/weed/util/log_buffer/log_read.go
+++ b/weed/util/log_buffer/log_read.go
@@ -75,9 +75,9 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition
}
bytesBuf, batchIndex, err = logBuffer.ReadFromBuffer(lastReadPosition)
if err == ResumeFromDiskError {
- // Try to read from disk if readFromDiskFn is available
- if logBuffer.ReadFromDiskFn != nil {
- lastReadPosition, isDone, err = logBuffer.ReadFromDiskFn(lastReadPosition, stopTsNs, eachLogDataFn)
+ // Try to read from disk if readFromDiskFn is available
+ if logBuffer.ReadFromDiskFn != nil {
+ lastReadPosition, isDone, err = logBuffer.ReadFromDiskFn(lastReadPosition, stopTsNs, eachLogDataFn)
if err != nil {
return lastReadPosition, isDone, err
}
diff --git a/weed/util/mem/slot_pool_test.go b/weed/util/mem/slot_pool_test.go
index 44f9ec0045..d457a7490c 100644
--- a/weed/util/mem/slot_pool_test.go
+++ b/weed/util/mem/slot_pool_test.go
@@ -1,8 +1,9 @@
package mem
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func TestAllocateFree(t *testing.T) {
diff --git a/weed/util/minfreespace.go b/weed/util/minfreespace.go
index 0c4461ff1f..9fd041ddc8 100644
--- a/weed/util/minfreespace.go
+++ b/weed/util/minfreespace.go
@@ -3,9 +3,10 @@ package util
import (
"errors"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"strconv"
"strings"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
)
// MinFreeSpaceType is the type of MinFreeSpace.
diff --git a/weed/util/queue_test.go b/weed/util/queue_test.go
index a79552893e..39fa7410f4 100644
--- a/weed/util/queue_test.go
+++ b/weed/util/queue_test.go
@@ -1,8 +1,9 @@
package util
import (
- "github.com/stretchr/testify/assert"
"testing"
+
+ "github.com/stretchr/testify/assert"
)
func TestNewQueue(t *testing.T) {
diff --git a/weed/util/skiplist/name_batch.go b/weed/util/skiplist/name_batch.go
index 1ab2a6b1f6..c0a759f3a4 100644
--- a/weed/util/skiplist/name_batch.go
+++ b/weed/util/skiplist/name_batch.go
@@ -1,10 +1,11 @@
package skiplist
import (
- "github.com/seaweedfs/seaweedfs/weed/glog"
- "google.golang.org/protobuf/proto"
"slices"
"strings"
+
+ "github.com/seaweedfs/seaweedfs/weed/glog"
+ "google.golang.org/protobuf/proto"
)
type NameBatch struct {
diff --git a/weed/util/skiplist/skiplist.pb.go b/weed/util/skiplist/skiplist.pb.go
index de3efa513c..09a9dab9a0 100644
--- a/weed/util/skiplist/skiplist.pb.go
+++ b/weed/util/skiplist/skiplist.pb.go
@@ -7,10 +7,11 @@
package skiplist
import (
- protoreflect "google.golang.org/protobuf/reflect/protoreflect"
- protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
+
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
const (
diff --git a/weed/wdclient/masterclient_test.go b/weed/wdclient/masterclient_test.go
index bf992e8847..e19ce9e805 100644
--- a/weed/wdclient/masterclient_test.go
+++ b/weed/wdclient/masterclient_test.go
@@ -101,5 +101,3 @@ func TestMasterClientFilerGroupLogging(t *testing.T) {
t.Errorf("Expected clientType %s, got %s", clientType, mc.clientType)
}
}
-
-
diff --git a/weed/wdclient/net2/managed_connection.go b/weed/wdclient/net2/managed_connection.go
index a0cc4f3589..d4696739ea 100644
--- a/weed/wdclient/net2/managed_connection.go
+++ b/weed/wdclient/net2/managed_connection.go
@@ -6,6 +6,7 @@ import (
"time"
"errors"
+
"github.com/seaweedfs/seaweedfs/weed/wdclient/resource_pool"
)
diff --git a/weed/wdclient/vid_map_test.go b/weed/wdclient/vid_map_test.go
index a734c6b0cf..7a828fdad4 100644
--- a/weed/wdclient/vid_map_test.go
+++ b/weed/wdclient/vid_map_test.go
@@ -3,12 +3,13 @@ package wdclient
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/pb"
- "google.golang.org/grpc"
"strconv"
"sync"
"testing"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/pb"
+ "google.golang.org/grpc"
)
func TestLocationIndex(t *testing.T) {