Browse Source

"golang.org/x/exp/slices" => "slices" and go fmt

pull/6207/merge
chrislu 2 days ago
parent
commit
ec155022e7
  1. 2
      weed/command/master.go
  2. 2
      weed/filer/filechunks2_test.go
  3. 2
      weed/filer/filechunks_read.go
  4. 3
      weed/filer/meta_replay.go
  5. 2
      weed/filer/redis/universal_redis_store.go
  6. 2
      weed/filer/redis3/redis_cluster_store.go
  7. 2
      weed/filer/redis3/redis_sentinel_store.go
  8. 2
      weed/filer/redis3/redis_store.go
  9. 4
      weed/filer/stream.go
  10. 2
      weed/mq/client/cmd/weed_pub_kv/publisher_kv.go
  11. 2
      weed/mq/client/cmd/weed_sub_kv/subscriber_kv.go
  12. 4
      weed/operation/upload_content.go
  13. 2
      weed/s3api/filer_multipart.go
  14. 2
      weed/s3api/s3api_acl_helper.go
  15. 2
      weed/s3api/s3api_object_handlers_delete.go
  16. 2
      weed/server/filer_server_handlers_write_upload.go
  17. 2
      weed/shell/command_ec_common.go
  18. 2
      weed/shell/command_fs_merge_volumes.go
  19. 2
      weed/shell/command_fs_verify.go
  20. 2
      weed/shell/command_volume_balance.go
  21. 2
      weed/shell/command_volume_check_disk.go
  22. 6
      weed/shell/command_volume_fix_replication.go
  23. 2
      weed/shell/command_volume_list.go
  24. 2
      weed/shell/command_volume_server_evacuate.go
  25. 2
      weed/shell/shell_liner.go
  26. 2
      weed/storage/disk_location_ec.go
  27. 2
      weed/storage/erasure_coding/ec_volume.go
  28. 2
      weed/topology/data_center.go
  29. 2
      weed/topology/rack.go
  30. 2
      weed/topology/topology_info.go
  31. 2
      weed/util/chunk_cache/on_disk_cache_layer.go
  32. 2
      weed/util/skiplist/name_batch.go

2
weed/command/master.go

@ -11,7 +11,7 @@ import (
hashicorpRaft "github.com/hashicorp/raft"
"golang.org/x/exp/slices"
"slices"
"github.com/gorilla/mux"
"github.com/seaweedfs/raft/protobuf"

2
weed/filer/filechunks2_test.go

@ -2,8 +2,8 @@ package filer
import (
"github.com/stretchr/testify/assert"
"golang.org/x/exp/slices"
"log"
"slices"
"testing"
"github.com/seaweedfs/seaweedfs/weed/glog"

2
weed/filer/filechunks_read.go

@ -3,7 +3,7 @@ package filer
import (
"container/list"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"golang.org/x/exp/slices"
"slices"
)
func readResolvedChunks(chunks []*filer_pb.FileChunk, startOffset int64, stopOffset int64) (visibles *IntervalList[*VisibleInterval]) {

3
weed/filer/meta_replay.go

@ -37,10 +37,9 @@ func Replay(filerStore FilerStore, resp *filer_pb.SubscribeMetadataResponse) err
return nil
}
// ParallelProcessDirectoryStructure processes each entry in parallel, and also ensure parent directories are processed first.
// This also assumes the parent directories are in the entryChan already.
func ParallelProcessDirectoryStructure(entryChan chan *Entry, concurrency int, eachEntryFn func(entry *Entry)(error)) (firstErr error) {
func ParallelProcessDirectoryStructure(entryChan chan *Entry, concurrency int, eachEntryFn func(entry *Entry) error) (firstErr error) {
executors := util.NewLimitedConcurrentExecutor(concurrency)

2
weed/filer/redis/universal_redis_store.go

@ -3,7 +3,7 @@ package redis
import (
"context"
"fmt"
"golang.org/x/exp/slices"
"slices"
"strings"
"time"

2
weed/filer/redis3/redis_cluster_store.go

@ -1,9 +1,9 @@
package redis3
import (
"github.com/redis/go-redis/v9"
"github.com/go-redsync/redsync/v4"
"github.com/go-redsync/redsync/v4/redis/goredis/v9"
"github.com/redis/go-redis/v9"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/util"
)

2
weed/filer/redis3/redis_sentinel_store.go

@ -3,9 +3,9 @@ package redis3
import (
"time"
"github.com/redis/go-redis/v9"
"github.com/go-redsync/redsync/v4"
"github.com/go-redsync/redsync/v4/redis/goredis/v9"
"github.com/redis/go-redis/v9"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/util"
)

2
weed/filer/redis3/redis_store.go

@ -1,9 +1,9 @@
package redis3
import (
"github.com/redis/go-redis/v9"
"github.com/go-redsync/redsync/v4"
"github.com/go-redsync/redsync/v4/redis/goredis/v9"
"github.com/redis/go-redis/v9"
"github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/util"
)

4
weed/filer/stream.go

@ -9,14 +9,14 @@ import (
"sync"
"time"
"golang.org/x/exp/slices"
"slices"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/stats"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
)
var getLookupFileIdBackoffSchedule = []time.Duration{

2
weed/mq/client/cmd/weed_pub_kv/publisher_kv.go

@ -5,11 +5,11 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/mq/client/pub_client"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"log"
"strings"
"sync"
"time"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
var (

2
weed/mq/client/cmd/weed_sub_kv/subscriber_kv.go

@ -7,11 +7,11 @@ import (
"github.com/seaweedfs/seaweedfs/weed/mq/client/sub_client"
"github.com/seaweedfs/seaweedfs/weed/mq/topic"
"github.com/seaweedfs/seaweedfs/weed/util"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"strings"
"time"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
var (

4
weed/operation/upload_content.go

@ -9,11 +9,11 @@ import (
"io"
"mime"
"mime/multipart"
"sync"
"net/http"
"net/textproto"
"path/filepath"
"strings"
"sync"
"time"
"github.com/seaweedfs/seaweedfs/weed/glog"
@ -96,7 +96,7 @@ func NewUploader() (*Uploader, error) {
return uploader, uploaderErr
}
func newUploader(httpClient HTTPClient) (*Uploader) {
func newUploader(httpClient HTTPClient) *Uploader {
return &Uploader{
httpClient: httpClient,
}

2
weed/s3api/filer_multipart.go

@ -7,9 +7,9 @@ import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/stats"
"golang.org/x/exp/slices"
"math"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"

2
weed/s3api/s3api_acl_helper.go

@ -9,9 +9,9 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3err"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
"net/http"
"strings"
util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
type AccountManager interface {

2
weed/s3api/s3api_object_handlers_delete.go

@ -3,8 +3,10 @@ package s3api
import (
"encoding/xml"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"
"io"
"net/http"
"slices"
"strings"
"github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants"

2
weed/server/filer_server_handlers_write_upload.go

@ -11,7 +11,7 @@ import (
"sync"
"time"
"golang.org/x/exp/slices"
"slices"
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/operation"

2
weed/shell/command_ec_common.go

@ -18,8 +18,8 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
"google.golang.org/grpc"
"slices"
)
type DataCenterId string

2
weed/shell/command_fs_merge_volumes.go

@ -13,7 +13,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/wdclient"
"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
"slices"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"

2
weed/shell/command_fs_verify.go

@ -20,7 +20,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/util"
"go.uber.org/atomic"
"golang.org/x/exp/slices"
"slices"
)
func init() {

2
weed/shell/command_volume_balance.go

@ -13,7 +13,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
"slices"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"

2
weed/shell/command_volume_check_disk.go

@ -17,8 +17,8 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/server/constants"
"github.com/seaweedfs/seaweedfs/weed/storage/needle_map"
"golang.org/x/exp/slices"
"google.golang.org/grpc"
"slices"
)
func init() {

6
weed/shell/command_volume_fix_replication.go

@ -13,10 +13,8 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/needle_map"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/seaweedfs/seaweedfs/weed/util"
"golang.org/x/exp/slices"
"google.golang.org/grpc"
"slices"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
@ -346,7 +344,7 @@ func (c *commandVolumeFixReplication) fixOneUnderReplicatedVolume(commandEnv *Co
}
}
if resp.ProcessedBytes > 0 {
fmt.Fprintf(writer, "volume %d processed %s bytes\n", replica.info.Id, util.BytesToHumanReadable(uint64(resp.ProcessedBytes)))
fmt.Fprintf(writer, "volume %d processed %d bytes\n", replica.info.Id, resp.ProcessedBytes)
}
}

2
weed/shell/command_volume_list.go

@ -7,8 +7,8 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
"path/filepath"
"slices"
"strings"
"time"

2
weed/shell/command_volume_server_evacuate.go

@ -11,7 +11,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
"github.com/seaweedfs/seaweedfs/weed/storage/super_block"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
"slices"
)
func init() {

2
weed/shell/shell_liner.go

@ -8,12 +8,12 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/util"
"github.com/seaweedfs/seaweedfs/weed/util/grace"
"golang.org/x/exp/slices"
"io"
"math/rand"
"os"
"path"
"regexp"
"slices"
"strings"
"github.com/peterh/liner"

2
weed/storage/disk_location_ec.go

@ -8,7 +8,7 @@ import (
"strconv"
"strings"
"golang.org/x/exp/slices"
"slices"
"github.com/seaweedfs/seaweedfs/weed/storage/erasure_coding"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"

2
weed/storage/erasure_coding/ec_volume.go

@ -9,7 +9,7 @@ import (
"sync"
"time"
"golang.org/x/exp/slices"
"slices"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"

2
weed/topology/data_center.go

@ -2,7 +2,7 @@ package topology
import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"golang.org/x/exp/slices"
"slices"
"strings"
)

2
weed/topology/rack.go

@ -4,7 +4,7 @@ import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"github.com/seaweedfs/seaweedfs/weed/util"
"golang.org/x/exp/slices"
"slices"
"strings"
"time"
)

2
weed/topology/topology_info.go

@ -2,7 +2,7 @@ package topology
import (
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"golang.org/x/exp/slices"
"slices"
"strings"
)

2
weed/util/chunk_cache/on_disk_cache_layer.go

@ -5,8 +5,8 @@ import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/storage"
"github.com/seaweedfs/seaweedfs/weed/storage/types"
"golang.org/x/exp/slices"
"path"
"slices"
)
type OnDiskCacheLayer struct {

2
weed/util/skiplist/name_batch.go

@ -2,8 +2,8 @@ package skiplist
import (
"github.com/seaweedfs/seaweedfs/weed/glog"
"golang.org/x/exp/slices"
"google.golang.org/protobuf/proto"
"slices"
"strings"
)

Loading…
Cancel
Save