diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-04-12 21:00:55 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-04-12 21:00:55 -0700 |
| commit | 7764e0465ce976bb528c27bb9aa25857102570ef (patch) | |
| tree | 7163cf7d7b940ea3ecf7971024f5469cdcd56eee /weed/util/chunk_cache/chunk_cache_on_disk_test.go | |
| parent | 8e23dc078b6790ace902c09ed71963c9ce49acdb (diff) | |
| download | seaweedfs-7764e0465ce976bb528c27bb9aa25857102570ef.tar.xz seaweedfs-7764e0465ce976bb528c27bb9aa25857102570ef.zip | |
refactoring
Diffstat (limited to 'weed/util/chunk_cache/chunk_cache_on_disk_test.go')
| -rw-r--r-- | weed/util/chunk_cache/chunk_cache_on_disk_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/weed/util/chunk_cache/chunk_cache_on_disk_test.go b/weed/util/chunk_cache/chunk_cache_on_disk_test.go index 256b10139..f93daf5a7 100644 --- a/weed/util/chunk_cache/chunk_cache_on_disk_test.go +++ b/weed/util/chunk_cache/chunk_cache_on_disk_test.go @@ -21,11 +21,11 @@ func TestOnDisk(t *testing.T) { writeCount := 5 type test_data struct { - data []byte + data []byte fileId string } testData := make([]*test_data, writeCount) - for i:=0;i<writeCount;i++{ + for i := 0; i < writeCount; i++ { buff := make([]byte, 1024*1024) rand.Read(buff) testData[i] = &test_data{ @@ -35,7 +35,7 @@ func TestOnDisk(t *testing.T) { cache.SetChunk(testData[i].fileId, testData[i].data) } - for i:=0;i<writeCount;i++{ + for i := 0; i < writeCount; i++ { data := cache.GetChunk(testData[i].fileId) if bytes.Compare(data, testData[i].data) != 0 { t.Errorf("failed to write to and read from cache: %d", i) @@ -46,7 +46,7 @@ func TestOnDisk(t *testing.T) { cache = NewChunkCache(0, tmpDir, totalDiskSizeMb, segmentCount) - for i:=0;i<writeCount;i++{ + for i := 0; i < writeCount; i++ { data := cache.GetChunk(testData[i].fileId) if bytes.Compare(data, testData[i].data) != 0 { t.Errorf("failed to write to and read from cache: %d", i) |
