refactoring to typed Size

Go is amazing with refactoring!
This commit is contained in:
Chris Lu
2020-08-18 17:04:28 -07:00
parent 618b2f6829
commit 6a92f0bc7a
34 changed files with 118 additions and 106 deletions

View File

@@ -117,7 +117,7 @@ func TestCompaction(t *testing.T) {
if err != nil {
t.Fatalf("read file %d: %v", i, err)
}
if infos[i-1].size != uint32(size) {
if infos[i-1].size != types.Size(size) {
t.Fatalf("read file %d size mismatch expected %d found %d", i, infos[i-1].size, size)
}
if infos[i-1].crc != n.Checksum {
@@ -151,7 +151,7 @@ func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) {
}
type needleInfo struct {
size uint32
size types.Size
crc needle.CRC
}