aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/filechunks2_test.go
diff options
context:
space:
mode:
authora <eddy@gfxlabs.io>2022-04-20 14:01:42 -0700
committera <eddy@gfxlabs.io>2022-04-20 14:01:42 -0700
commit1d6a9e66b608f77a0da9a6903802bb24ff0629d7 (patch)
tree7f3e02d6e69d10913d882c5f87d9156001e1b77c /weed/filer/filechunks2_test.go
parent846858fb436cc061c40c4f2565ed3682e3758596 (diff)
parentd1fd40358215a6237f51e0918659f74cc7269ff1 (diff)
downloadseaweedfs-1d6a9e66b608f77a0da9a6903802bb24ff0629d7.tar.xz
seaweedfs-1d6a9e66b608f77a0da9a6903802bb24ff0629d7.zip
Merge branch 'master' into a
Diffstat (limited to 'weed/filer/filechunks2_test.go')
-rw-r--r--weed/filer/filechunks2_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/filer/filechunks2_test.go b/weed/filer/filechunks2_test.go
index 9f9566d9b..39dec87c9 100644
--- a/weed/filer/filechunks2_test.go
+++ b/weed/filer/filechunks2_test.go
@@ -1,7 +1,7 @@
package filer
import (
- "sort"
+ "golang.org/x/exp/slices"
"testing"
"github.com/chrislusf/seaweedfs/weed/glog"
@@ -34,11 +34,11 @@ func TestCompactFileChunksRealCase(t *testing.T) {
}
func printChunks(name string, chunks []*filer_pb.FileChunk) {
- sort.Slice(chunks, func(i, j int) bool {
- if chunks[i].Offset == chunks[j].Offset {
- return chunks[i].Mtime < chunks[j].Mtime
+ slices.SortFunc(chunks, func(a, b *filer_pb.FileChunk) bool {
+ if a.Offset == b.Offset {
+ return a.Mtime < b.Mtime
}
- return chunks[i].Offset < chunks[j].Offset
+ return a.Offset < b.Offset
})
for _, chunk := range chunks {
glog.V(0).Infof("%s chunk %s [%10d,%10d)", name, chunk.GetFileIdString(), chunk.Offset, chunk.Offset+int64(chunk.Size))