diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-10-16 16:06:18 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-10-16 16:06:18 -0700 |
| commit | 6c704eb2bac5a6f47e6b6ae71654a2176ae8c3ef (patch) | |
| tree | b5a12692d4d3e38a2046eaa8ed70b3bd708e18de | |
| parent | de7688c53989d90799e349ac105d3c8d4a06e6a7 (diff) | |
| download | seaweedfs-6c704eb2bac5a6f47e6b6ae71654a2176ae8c3ef.tar.xz seaweedfs-6c704eb2bac5a6f47e6b6ae71654a2176ae8c3ef.zip | |
go fmt
| -rw-r--r-- | weed/filer/filechunks_read.go | 2 | ||||
| -rw-r--r-- | weed/filer/filechunks_read_test.go | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/weed/filer/filechunks_read.go b/weed/filer/filechunks_read.go index b39f6a35c..bc05d9821 100644 --- a/weed/filer/filechunks_read.go +++ b/weed/filer/filechunks_read.go @@ -40,7 +40,7 @@ func readResolvedChunks(chunks []*filer_pb.FileChunk) (visibles []VisibleInterva for _, point := range points { if point.isStart { if len(queue) > 0 { - lastIndex := len(queue) -1 + lastIndex := len(queue) - 1 lastPoint := queue[lastIndex] if point.x != prevX && lastPoint.ts < point.ts { visibles = addToVisibles(visibles, prevX, lastPoint, point) diff --git a/weed/filer/filechunks_read_test.go b/weed/filer/filechunks_read_test.go index 1920f5185..50dda68d1 100644 --- a/weed/filer/filechunks_read_test.go +++ b/weed/filer/filechunks_read_test.go @@ -52,7 +52,7 @@ func TestReadResolvedChunks(t *testing.T) { func TestRandomizedReadResolvedChunks(t *testing.T) { - var limit int64 = 1024*1024 + var limit int64 = 1024 * 1024 array := make([]int64, limit) var chunks []*filer_pb.FileChunk for ts := int64(0); ts < 1024; ts++ { @@ -75,7 +75,7 @@ func TestRandomizedReadResolvedChunks(t *testing.T) { visibles := readResolvedChunks(chunks) for _, visible := range visibles { - for i := visible.start; i<visible.stop;i++{ + for i := visible.start; i < visible.stop; i++ { if array[i] != visible.modifiedTime { t.Errorf("position %d expected ts %d actual ts %d", i, array[i], visible.modifiedTime) } @@ -101,12 +101,12 @@ func randomWrite(array []int64, start int64, size int64, ts int64) *filer_pb.Fil func TestSequentialReadResolvedChunks(t *testing.T) { - var chunkSize int64 = 1024*1024*2 + var chunkSize int64 = 1024 * 1024 * 2 var chunks []*filer_pb.FileChunk for ts := int64(0); ts < 13; ts++ { chunks = append(chunks, &filer_pb.FileChunk{ FileId: "", - Offset: chunkSize*ts, + Offset: chunkSize * ts, Size: uint64(chunkSize), Mtime: 1, }) |
