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

* chore: execute goimports to format the code

Signed-off-by: promalert <promalert@outlook.com>

* goimports -w .

---------

Signed-off-by: promalert <promalert@outlook.com>
Co-authored-by: Chris Lu <chris.lu@gmail.com>
This commit is contained in:
promalert
2026-01-08 05:06:08 +08:00
committed by GitHub
parent 6432019d08
commit 9012069bd7
271 changed files with 608 additions and 461 deletions

View File

@@ -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) {

View File

@@ -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"
)

View File

@@ -4,6 +4,7 @@ import (
"context"
"encoding/base64"
"fmt"
"github.com/gocql/gocql"
"github.com/seaweedfs/seaweedfs/weed/filer"
)

View File

@@ -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"

View File

@@ -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 (

View File

@@ -203,6 +203,3 @@ func (q *CleanupQueue) OldestAge() time.Duration {
item := front.Value.(*queueItem)
return time.Since(item.queueTime)
}

View File

@@ -367,6 +367,3 @@ func TestCleanupQueue_Concurrent(t *testing.T) {
// Just verify no panic occurred and queue is in consistent state
_ = q.Len()
}

View File

@@ -433,4 +433,3 @@ func (efc *EmptyFolderCleaner) GetCachedFolderCount(folder string) (int, bool) {
}
return 0, false
}

View File

@@ -566,4 +566,3 @@ func TestEmptyFolderCleaner_queueFIFOOrder(t *testing.T) {
cleaner.Stop()
}

View File

@@ -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"
)

View File

@@ -3,6 +3,7 @@ package etcd
import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/filer"
)

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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]) {

View File

@@ -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) {

View File

@@ -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
}

View File

@@ -2,9 +2,10 @@ package hbase
import (
"context"
"time"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/tsuna/gohbase/hrpc"
"time"
)
const (

View File

@@ -2,8 +2,9 @@ package filer
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
"github.com/stretchr/testify/assert"
)
type IntervalInt int

View File

@@ -3,6 +3,7 @@ package leveldb
import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/syndtr/goleveldb/leveldb"
)

View File

@@ -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"
)

View File

@@ -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"
)

View File

@@ -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)

View File

@@ -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"
)

View File

@@ -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"
)

View File

@@ -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"

View File

@@ -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")
}

View File

@@ -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() {

View File

@@ -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{

View File

@@ -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"

View File

@@ -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() {

View File

@@ -2,6 +2,7 @@ package stored_procedure
import (
_ "embed"
"github.com/redis/go-redis/v9"
)

View File

@@ -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"

View File

@@ -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"

View File

@@ -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) {

View File

@@ -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"

View File

@@ -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) {

View File

@@ -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"