SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fix: comprehensive go vet error fixes and add CI enforcement (#7861)
Chris Lu1261e93ef2ac
diff --git a/.github/workflows/go.yml b/.github/workflows/go.ymlindex 34c393cee9..8dcc829a88 100644--- a/.github/workflows/go.yml+++ b/.github/workflows/go.yml@@ -33,6 +33,15 @@ jobs:run: |cd weed; go get -v -t -d ./...+ - name: Go Vet (excluding protobuf lock copying)+ run: |+ cd weed+ # Run go vet and filter out known protobuf MessageState lock copying warnings+ # These are expected in generated protobuf code with embedded sync.Mutex and are safe in practice+ go vet -v ./... 2>&1 | grep -v "MessageState contains sync.Mutex" | grep -v "IdentityAccessManagement contains sync.RWMutex" | tee vet-output.txt+ # Fail only if there are actual vet errors (not counting the filtered lock warnings)+ if grep -q "vet:" vet-output.txt; then exit 1; fi+- name: Buildrun: cd weed; go build -tags "elastic gocdk sqlite ydb tarantool tikv rclone" -v .diff --git a/weed/admin/dash/user_management.go b/weed/admin/dash/user_management.goindex 747c398d73..3a74a675f0 100644--- a/weed/admin/dash/user_management.go+++ b/weed/admin/dash/user_management.go@@ -326,9 +326,10 @@ func generateSecretKey() string {func generateAccountId() string {// Generate 12-digit account ID- b := make([]byte, 8)+ b := make([]byte, 4)rand.Read(b)- return fmt.Sprintf("%012d", b[0]<<24|b[1]<<16|b[2]<<8|b[3])+ val := (uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3]))+ return fmt.Sprintf("%012d", val)}func randomInt(max int) int {diff --git a/weed/command/filer_backup.go b/weed/command/filer_backup.goindex 380540fd92..996260c1e2 100644--- a/weed/command/filer_backup.go+++ b/weed/command/filer_backup.go@@ -3,6 +3,10 @@ package commandimport ("errors""fmt"+ "regexp"+ "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 ("github.com/seaweedfs/seaweedfs/weed/util""github.com/seaweedfs/seaweedfs/weed/util/http""google.golang.org/grpc"- "regexp"- "strings"- "time")type FilerBackupOptions struct {@@ -82,8 +83,8 @@ func runFilerBackup(cmd *Command, args []string) bool {time.Sleep(1747 * time.Millisecond)}}-- return true+ // Unreachable: satisfies bool return type signature for daemon function+ return false}const (diff --git a/weed/command/filer_meta_backup.go b/weed/command/filer_meta_backup.goindex f77f758ab7..89ef5b4bbe 100644--- a/weed/command/filer_meta_backup.go+++ b/weed/command/filer_meta_backup.go@@ -3,13 +3,14 @@ package commandimport ("context""fmt"+ "reflect"+ "strings"+ "time"+"github.com/seaweedfs/seaweedfs/weed/filer""github.com/seaweedfs/seaweedfs/weed/glog""github.com/spf13/viper""google.golang.org/grpc"- "reflect"- "strings"- "time""github.com/seaweedfs/seaweedfs/weed/pb""github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"@@ -100,8 +101,8 @@ func runFilerMetaBackup(cmd *Command, args []string) bool {time.Sleep(1747 * time.Millisecond)}}-- return true+ // Unreachable: satisfies bool return type signature for daemon function+ return false}func (metaBackup *FilerMetaBackupOptions) initStore(v *viper.Viper) error {@@ -186,8 +187,6 @@ func (metaBackup *FilerMetaBackupOptions) streamMetadataBackup() error {println("+", util.FullPath(message.NewParentPath).Child(message.NewEntry.Name))return store.InsertEntry(ctx, filer.FromPbEntry(message.NewParentPath, message.NewEntry))}-- return nil}processEventFnWithOffset := pb.AddOffsetFunc(eachEntryFunc, 3*time.Second, func(counter int64, lastTsNs int64) error {diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.goindex 8f752b6d7b..5663558f25 100644--- a/weed/command/filer_sync.go+++ b/weed/command/filer_sync.go@@ -262,8 +262,6 @@ func runFilerSynchronize(cmd *Command, args []string) bool {}select {}-- return true}// initOffsetFromTsMs Initialize offsetdiff --git a/weed/filer/mongodb/mongodb_store_kv.go b/weed/filer/mongodb/mongodb_store_kv.goindex 13d2dd08c7..193bb247b5 100644--- a/weed/filer/mongodb/mongodb_store_kv.go+++ b/weed/filer/mongodb/mongodb_store_kv.go@@ -18,8 +18,15 @@ func (store *MongodbStore) KvPut(ctx context.Context, key []byte, value []byte)c := store.connect.Database(store.database).Collection(store.collectionName)opts := options.Update().SetUpsert(true)- filter := bson.D{{"directory", dir}, {"name", name}}- update := bson.D{{"$set", bson.D{{"meta", value}}}}+ filter := bson.D{+ {Key: "directory", Value: dir},+ {Key: "name", Value: name},+ }+ update := bson.D{+ {Key: "$set", Value: bson.D{+ {Key: "meta", Value: value},+ }},+ }_, err = c.UpdateOne(ctx, filter, update, opts)diff --git a/weed/filer/redis3/ItemList.go b/weed/filer/redis3/ItemList.goindex 9e38089a73..05457e5967 100644--- a/weed/filer/redis3/ItemList.go+++ b/weed/filer/redis3/ItemList.go@@ -4,6 +4,7 @@ import ("bytes""context""fmt"+"github.com/redis/go-redis/v9""github.com/seaweedfs/seaweedfs/weed/util/skiplist")@@ -313,8 +314,6 @@ func (nl *ItemList) DeleteName(name string) error {// no action to takereturn nil}-- return nil}func (nl *ItemList) ListNames(startFrom string, visitNamesFn func(name string) bool) error {diff --git a/weed/iam/integration/iam_integration_test.go b/weed/iam/integration/iam_integration_test.goindex d413c3936e..830fc50def 100644--- a/weed/iam/integration/iam_integration_test.go+++ b/weed/iam/integration/iam_integration_test.go@@ -378,8 +378,8 @@ func setupIntegratedIAMSystem(t *testing.T) *IAMManager {// Configure and initializeconfig := &IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{time.Hour * 12},+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Hour * 12},Issuer: "test-sts",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/iam/integration/role_store_test.go b/weed/iam/integration/role_store_test.goindex 716eef3c2c..597577a420 100644--- a/weed/iam/integration/role_store_test.go+++ b/weed/iam/integration/role_store_test.go@@ -89,8 +89,8 @@ func TestDistributedIAMManagerWithRoleStore(t *testing.T) {// Create IAM manager with role store configurationconfig := &IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Duration(3600) * time.Second},- MaxSessionLength: sts.FlexibleDuration{time.Duration(43200) * time.Second},+ TokenDuration: sts.FlexibleDuration{Duration: time.Duration(3600) * time.Second},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Duration(43200) * time.Second},Issuer: "test-issuer",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/iamapi/iamapi_server.go b/weed/iamapi/iamapi_server.goindex e3979e4169..602c2f28e5 100644--- a/weed/iamapi/iamapi_server.go+++ b/weed/iamapi/iamapi_server.go@@ -23,6 +23,7 @@ import ("github.com/seaweedfs/seaweedfs/weed/util""github.com/seaweedfs/seaweedfs/weed/wdclient""google.golang.org/grpc"+ "google.golang.org/protobuf/proto")type IamS3ApiConfig interface {@@ -46,11 +47,11 @@ type IamServerOption struct {}type IamApiServer struct {- s3ApiConfig IamS3ApiConfig- iam *s3api.IdentityAccessManagement- shutdownContext context.Context- shutdownCancel context.CancelFunc- masterClient *wdclient.MasterClient+ s3ApiConfig IamS3ApiConfig+ iam *s3api.IdentityAccessManagement+ shutdownContext context.Context+ shutdownCancel context.CancelFunc+ masterClient *wdclient.MasterClient}var s3ApiConfigure IamS3ApiConfig@@ -63,19 +64,19 @@ func NewIamApiServerWithStore(router *mux.Router, option *IamServerOption, expliif len(option.Filers) == 0 {return nil, fmt.Errorf("at least one filer address is required")}-+masterClient := wdclient.NewMasterClient(option.GrpcDialOption, "", "iam", "", "", "", *pb.NewServiceDiscoveryFromMap(option.Masters))-+// Create a cancellable context for the master client connection// This allows graceful shutdown via Shutdown() methodshutdownCtx, shutdownCancel := context.WithCancel(context.Background())-+// Start KeepConnectedToMaster for volume location lookups// IAM config files are typically small and inline, but if they ever have chunks,// ReadEntry→StreamContent needs masterClient for volume lookupsglog.V(0).Infof("IAM API starting master client connection for volume location lookups")go masterClient.KeepConnectedToMaster(shutdownCtx)-+configure := &IamS3ApiConfigure{option: option,masterClient: masterClient,@@ -143,7 +144,8 @@ func (iama *IamS3ApiConfigure) GetS3ApiConfigurationFromCredentialManager(s3cfgif err != nil {return fmt.Errorf("failed to load configuration from credential manager: %w", err)}- *s3cfg = *config+ // Use proto.Merge to avoid copying the sync.Mutex embedded in the message+ proto.Merge(s3cfg, config)return nil}diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.goindex 4a01e30e78..444c1930aa 100644--- a/weed/mount/inode_to_path.go+++ b/weed/mount/inode_to_path.go@@ -59,15 +59,13 @@ func NewInodeToPath(root util.FullPath, ttlSec int) *InodeToPath {// EnsurePath make sure the full path is tracked, used by symlink.func (i *InodeToPath) EnsurePath(path util.FullPath, isDirectory bool) bool {- for {- dir, _ := path.DirAndName()- if dir == "/" {- return true- }- if i.EnsurePath(util.FullPath(dir), true) {- i.Lookup(path, time.Now().Unix(), isDirectory, false, 0, false)- return true- }+ dir, _ := path.DirAndName()+ if dir == "/" {+ return true+ }+ if i.EnsurePath(util.FullPath(dir), true) {+ i.Lookup(path, time.Now().Unix(), isDirectory, false, 0, false)+ return true}return false}diff --git a/weed/mq/broker/broker_grpc_pub_balancer.go b/weed/mq/broker/broker_grpc_pub_balancer.goindex 8327ead7da..0234d3b2e3 100644--- a/weed/mq/broker/broker_grpc_pub_balancer.go+++ b/weed/mq/broker/broker_grpc_pub_balancer.go@@ -2,6 +2,7 @@ package brokerimport ("fmt"+"github.com/seaweedfs/seaweedfs/weed/mq/pub_balancer""github.com/seaweedfs/seaweedfs/weed/pb/mq_pb""google.golang.org/grpc/codes"@@ -44,6 +45,4 @@ func (b *MessageQueueBroker) PublisherToPubBalancer(stream mq_pb.SeaweedMessagin// glog.V(4).Infof("received from %v: %+v", initMessage.Broker, receivedStats)}}-- return nil}diff --git a/weed/mq/client/agent_client/subscribe_session.go b/weed/mq/client/agent_client/subscribe_session.goindex f9803b66b2..9632f9e25a 100644--- a/weed/mq/client/agent_client/subscribe_session.go+++ b/weed/mq/client/agent_client/subscribe_session.go@@ -3,6 +3,7 @@ package agent_clientimport ("context""fmt"+"github.com/seaweedfs/seaweedfs/weed/mq/topic""github.com/seaweedfs/seaweedfs/weed/pb/mq_agent_pb""github.com/seaweedfs/seaweedfs/weed/pb/schema_pb"@@ -76,12 +77,11 @@ func (a *SubscribeSession) SubscribeMessageRecord(for {resp, err := a.stream.Recv()if err != nil {+ if onCompletionFn != nil {+ onCompletionFn()+ }return err}onEachMessageFn(resp.Key, resp.Value)}- if onCompletionFn != nil {- onCompletionFn()- }- return nil}diff --git a/weed/mq/client/sub_client/connect_to_sub_coordinator.go b/weed/mq/client/sub_client/connect_to_sub_coordinator.goindex e88aaca2f7..6ca205c694 100644--- a/weed/mq/client/sub_client/connect_to_sub_coordinator.go+++ b/weed/mq/client/sub_client/connect_to_sub_coordinator.go@@ -1,10 +1,11 @@package sub_clientimport (+ "time"+"github.com/seaweedfs/seaweedfs/weed/glog""github.com/seaweedfs/seaweedfs/weed/pb""github.com/seaweedfs/seaweedfs/weed/pb/mq_pb"- "time")func (sub *TopicSubscriber) doKeepConnectedToSubCoordinator() {@@ -94,8 +95,6 @@ func (sub *TopicSubscriber) doKeepConnectedToSubCoordinator() {sub.brokerPartitionAssignmentChan <- respglog.V(0).Infof("Received assignment: %+v", resp)}-- return nil})}glog.V(0).Infof("subscriber %s/%s waiting for more assignments", sub.ContentConfig.Topic, sub.SubscriberConfig.ConsumerGroup)diff --git a/weed/mq/kafka/integration/broker_client_subscribe.go b/weed/mq/kafka/integration/broker_client_subscribe.goindex e9884ea4d8..129b778441 100644--- a/weed/mq/kafka/integration/broker_client_subscribe.go+++ b/weed/mq/kafka/integration/broker_client_subscribe.go@@ -44,12 +44,14 @@ func (bc *BrokerClient) CreateFreshSubscriber(topic string, partition int32, stastream, err := bc.client.SubscribeMessage(subscriberCtx)if err != nil {+ subscriberCancel()return nil, fmt.Errorf("failed to create subscribe stream: %v", err)}// Get the actual partition assignment from the brokeractualPartition, err := bc.getActualPartitionAssignment(topic, partition)if err != nil {+ subscriberCancel()return nil, fmt.Errorf("failed to get actual partition assignment for subscribe: %v", err)}@@ -63,6 +65,7 @@ func (bc *BrokerClient) CreateFreshSubscriber(topic string, partition int32, statopic, partition, startOffset, offsetType, consumerGroup, consumerID)if err := stream.Send(initReq); err != nil {+ subscriberCancel()return nil, fmt.Errorf("failed to send subscribe init: %v", err)}@@ -163,12 +166,14 @@ func (bc *BrokerClient) GetOrCreateSubscriber(topic string, partition int32, stastream, err := bc.client.SubscribeMessage(subscriberCtx)if err != nil {+ subscriberCancel()return nil, fmt.Errorf("failed to create subscribe stream: %v", err)}- // Get the actual partition assignment from the broker instead of using Kafka partition mapping+ // Get the actual partition assignment from the brokeractualPartition, err := bc.getActualPartitionAssignment(topic, partition)if err != nil {+ subscriberCancel()return nil, fmt.Errorf("failed to get actual partition assignment for subscribe: %v", err)}@@ -198,6 +203,7 @@ func (bc *BrokerClient) GetOrCreateSubscriber(topic string, partition int32, sta// Send init message using the actual partition structure that the broker allocatedinitReq := createSubscribeInitMessage(topic, actualPartition, offsetValue, offsetType, consumerGroup, consumerID)if err := stream.Send(initReq); err != nil {+ subscriberCancel()return nil, fmt.Errorf("failed to send subscribe init: %v", err)}diff --git a/weed/mq/schema/schema_builder.go b/weed/mq/schema/schema_builder.goindex 13f8af1858..6d8852a3e1 100644--- a/weed/mq/schema/schema_builder.go+++ b/weed/mq/schema/schema_builder.go@@ -8,19 +8,19 @@ import (var (// Basic scalar types- TypeBoolean = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_BOOL}}- TypeInt32 = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_INT32}}- TypeInt64 = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_INT64}}- TypeFloat = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_FLOAT}}- TypeDouble = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_DOUBLE}}- TypeBytes = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_BYTES}}- TypeString = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_STRING}}+ TypeBoolean = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_BOOL}}+ TypeInt32 = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_INT32}}+ TypeInt64 = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_INT64}}+ TypeFloat = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_FLOAT}}+ TypeDouble = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_DOUBLE}}+ TypeBytes = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_BYTES}}+ TypeString = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_STRING}}// Parquet logical types- TypeTimestamp = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_TIMESTAMP}}- TypeDate = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_DATE}}- TypeDecimal = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_DECIMAL}}- TypeTime = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{schema_pb.ScalarType_TIME}}+ TypeTimestamp = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_TIMESTAMP}}+ TypeDate = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_DATE}}+ TypeDecimal = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_DECIMAL}}+ TypeTime = &schema_pb.Type{Kind: &schema_pb.Type_ScalarType{ScalarType: schema_pb.ScalarType_TIME}})type RecordTypeBuilder struct {diff --git a/weed/query/sqltypes/unsafe.go b/weed/query/sqltypes/unsafe.goindex e322c92ce1..a387b7525b 100644--- a/weed/query/sqltypes/unsafe.go+++ b/weed/query/sqltypes/unsafe.go@@ -1,7 +1,6 @@package sqltypesimport (- "reflect""unsafe")@@ -10,11 +9,7 @@ func BytesToString(b []byte) (s string) {if len(b) == 0 {return ""}-- bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))- sh := reflect.StringHeader{Data: bh.Data, Len: bh.Len}-- return *(*string)(unsafe.Pointer(&sh))+ return unsafe.String(unsafe.SliceData(b), len(b))}// StringToBytes casts string to slice without copy@@ -22,9 +17,5 @@ func StringToBytes(s string) []byte {if len(s) == 0 {return []byte{}}-- sh := (*reflect.StringHeader)(unsafe.Pointer(&s))- bh := reflect.SliceHeader{Data: sh.Data, Len: sh.Len, Cap: sh.Len}-- return *(*[]byte)(unsafe.Pointer(&bh))+ return unsafe.Slice(unsafe.StringData(s), len(s))}diff --git a/weed/s3api/s3_end_to_end_test.go b/weed/s3api/s3_end_to_end_test.goindex 75c76b2783..5c08551c7a 100644--- a/weed/s3api/s3_end_to_end_test.go+++ b/weed/s3api/s3_end_to_end_test.go@@ -310,8 +310,8 @@ func setupCompleteS3IAMSystem(t *testing.T) (http.Handler, *integration.IAMManag// Initialize with test configurationconfig := &integration.IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{time.Hour * 12},+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Hour * 12},Issuer: "test-sts",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/s3api/s3_iam_simple_test.go b/weed/s3api/s3_iam_simple_test.goindex 41dbbbed81..f0f6a8f629 100644--- a/weed/s3api/s3_iam_simple_test.go+++ b/weed/s3api/s3_iam_simple_test.go@@ -25,8 +25,8 @@ func TestS3IAMMiddleware(t *testing.T) {// Initialize with test configurationconfig := &integration.IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{time.Hour * 12},+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Hour * 12},Issuer: "test-sts",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/s3api/s3_jwt_auth_test.go b/weed/s3api/s3_jwt_auth_test.goindex 0e74aea012..b2b169ae7e 100644--- a/weed/s3api/s3_jwt_auth_test.go+++ b/weed/s3api/s3_jwt_auth_test.go@@ -292,8 +292,8 @@ func setupTestIAMManager(t *testing.T) *integration.IAMManager {// Initialize with test configurationconfig := &integration.IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{time.Hour * 12},+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Hour * 12},Issuer: "test-sts",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/s3api/s3_multipart_iam_test.go b/weed/s3api/s3_multipart_iam_test.goindex 725bd0304b..7169891c0f 100644--- a/weed/s3api/s3_multipart_iam_test.go+++ b/weed/s3api/s3_multipart_iam_test.go@@ -480,8 +480,8 @@ func setupTestIAMManagerForMultipart(t *testing.T) *integration.IAMManager {// Initialize with test configurationconfig := &integration.IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{time.Hour * 12},+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Hour * 12},Issuer: "test-sts",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/s3api/s3_presigned_url_iam_test.go b/weed/s3api/s3_presigned_url_iam_test.goindex b8da33053f..2a2686f7bc 100644--- a/weed/s3api/s3_presigned_url_iam_test.go+++ b/weed/s3api/s3_presigned_url_iam_test.go@@ -444,8 +444,8 @@ func setupTestIAMManagerForPresigned(t *testing.T) *integration.IAMManager {// Initialize with test configurationconfig := &integration.IAMConfig{STS: &sts.STSConfig{- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{time.Hour * 12},+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: time.Hour * 12},Issuer: "test-sts",SigningKey: []byte("test-signing-key-32-characters-long"),},diff --git a/weed/s3api/s3_token_differentiation_test.go b/weed/s3api/s3_token_differentiation_test.goindex cf61703ada..0fc520293f 100644--- a/weed/s3api/s3_token_differentiation_test.go+++ b/weed/s3api/s3_token_differentiation_test.go@@ -19,8 +19,8 @@ func TestS3IAMIntegration_isSTSIssuer(t *testing.T) {stsConfig := &sts.STSConfig{Issuer: testIssuer,SigningKey: []byte("test-signing-key-32-characters-long"),- TokenDuration: sts.FlexibleDuration{time.Hour},- MaxSessionLength: sts.FlexibleDuration{12 * time.Hour}, // Required field+ TokenDuration: sts.FlexibleDuration{Duration: time.Hour},+ MaxSessionLength: sts.FlexibleDuration{Duration: 12 * time.Hour}, // Required field}// Initialize STS service with config (this sets the Config field)diff --git a/weed/server/volume_grpc_client_to_master.go b/weed/server/volume_grpc_client_to_master.goindex 9c2f8b2138..5022a9ede4 100644--- a/weed/server/volume_grpc_client_to_master.go+++ b/weed/server/volume_grpc_client_to_master.go@@ -219,7 +219,7 @@ func (vs *VolumeServer) doHeartbeatWithRetry(masterAddress pb.ServerAddress, grpDataCenter: dataCenter,Rack: rack,NewVolumes: []*master_pb.VolumeShortInformationMessage{- &volumeMessage,+ &volumeMessage, // volumeMessage is already a copy from the channel receive},}glog.V(0).Infof("volume server %s:%d adds volume %d", vs.store.Ip, vs.store.Port, volumeMessage.Id)@@ -234,7 +234,7 @@ func (vs *VolumeServer) doHeartbeatWithRetry(masterAddress pb.ServerAddress, grpDataCenter: dataCenter,Rack: rack,NewEcShards: []*master_pb.VolumeEcShardInformationMessage{- &ecShardMessage,+ &ecShardMessage, // ecShardMessage is already a copy from the channel receive},}glog.V(0).Infof("volume server %s:%d adds ec shard %d:%d", vs.store.Ip, vs.store.Port, ecShardMessage.Id,@@ -250,7 +250,7 @@ func (vs *VolumeServer) doHeartbeatWithRetry(masterAddress pb.ServerAddress, grpDataCenter: dataCenter,Rack: rack,DeletedVolumes: []*master_pb.VolumeShortInformationMessage{- &volumeMessage,+ &volumeMessage, // volumeMessage is already a copy from the channel receive},}glog.V(0).Infof("volume server %s:%d deletes volume %d", vs.store.Ip, vs.store.Port, volumeMessage.Id)@@ -265,7 +265,7 @@ func (vs *VolumeServer) doHeartbeatWithRetry(masterAddress pb.ServerAddress, grpDataCenter: dataCenter,Rack: rack,DeletedEcShards: []*master_pb.VolumeEcShardInformationMessage{- &ecShardMessage,+ &ecShardMessage, // ecShardMessage is already a copy from the channel receive},}glog.V(0).Infof("volume server %s:%d deletes ec shard %d:%d", vs.store.Ip, vs.store.Port, ecShardMessage.Id,diff --git a/weed/util/skiplist/name_list.go b/weed/util/skiplist/name_list.goindex c291484fbc..5171734244 100644--- a/weed/util/skiplist/name_list.go+++ b/weed/util/skiplist/name_list.go@@ -272,8 +272,6 @@ func (nl *NameList) DeleteName(name string) error {// case 3.2 update prevNodereturn nl.skipList.ChangeValue(prevNode, prevNameBatch.ToBytes())}-- return nil}func (nl *NameList) ListNames(startFrom string, visitNamesFn func(name string) bool) error {