From f343c8ba361fcf6c548513560edee0500ab1e1ad Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Mon, 20 Jun 2016 21:00:39 +0000 Subject: [PATCH] lib/model, lib/scanner: Silence vet warnings GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3333 --- lib/model/model_test.go | 6 +++--- lib/scanner/blocks_test.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/model/model_test.go b/lib/model/model_test.go index 04b810fdd..4a453565b 100644 --- a/lib/model/model_test.go +++ b/lib/model/model_test.go @@ -144,7 +144,7 @@ func genFiles(n int) []protocol.FileInfo { files[i] = protocol.FileInfo{ Name: fmt.Sprintf("file%d", i), Modified: t, - Blocks: []protocol.BlockInfo{{0, 100, []byte("some hash bytes")}}, + Blocks: []protocol.BlockInfo{{Offset: 0, Size: 100, Hash: []byte("some hash bytes")}}, } } @@ -288,7 +288,7 @@ func BenchmarkRequest(b *testing.B) { files[i] = protocol.FileInfo{ Name: fmt.Sprintf("file%d", i), Modified: t, - Blocks: []protocol.BlockInfo{{0, 100, []byte("some hash bytes")}}, + Blocks: []protocol.BlockInfo{{Offset: 0, Size: 100, Hash: []byte("some hash bytes")}}, } } @@ -1185,7 +1185,7 @@ func genDeepFiles(n, d int) []protocol.FileInfo { } files[i].Modified = t - files[i].Blocks = []protocol.BlockInfo{{0, 100, []byte("some hash bytes")}} + files[i].Blocks = []protocol.BlockInfo{{Offset: 0, Size: 100, Hash: []byte("some hash bytes")}} } return files diff --git a/lib/scanner/blocks_test.go b/lib/scanner/blocks_test.go index 9fe8981b2..349ea017d 100644 --- a/lib/scanner/blocks_test.go +++ b/lib/scanner/blocks_test.go @@ -92,15 +92,15 @@ var diffTestData = []struct { {"contents", "contents", 1024, []protocol.BlockInfo{}}, {"", "", 1024, []protocol.BlockInfo{}}, {"contents", "contents", 3, []protocol.BlockInfo{}}, - {"contents", "cantents", 3, []protocol.BlockInfo{{0, 3, nil}}}, - {"contents", "contants", 3, []protocol.BlockInfo{{3, 3, nil}}}, - {"contents", "cantants", 3, []protocol.BlockInfo{{0, 3, nil}, {3, 3, nil}}}, - {"contents", "", 3, []protocol.BlockInfo{{0, 0, nil}}}, - {"", "contents", 3, []protocol.BlockInfo{{0, 3, nil}, {3, 3, nil}, {6, 2, nil}}}, - {"con", "contents", 3, []protocol.BlockInfo{{3, 3, nil}, {6, 2, nil}}}, + {"contents", "cantents", 3, []protocol.BlockInfo{{Offset: 0, Size: 3}}}, + {"contents", "contants", 3, []protocol.BlockInfo{{Offset: 3, Size: 3}}}, + {"contents", "cantants", 3, []protocol.BlockInfo{{Offset: 0, Size: 3}, {Offset: 3, Size: 3}}}, + {"contents", "", 3, []protocol.BlockInfo{{Offset: 0, Size: 0}}}, + {"", "contents", 3, []protocol.BlockInfo{{Offset: 0, Size: 3}, {Offset: 3, Size: 3}, {Offset: 6, Size: 2}}}, + {"con", "contents", 3, []protocol.BlockInfo{{Offset: 3, Size: 3}, {Offset: 6, Size: 2}}}, {"contents", "con", 3, nil}, - {"contents", "cont", 3, []protocol.BlockInfo{{3, 1, nil}}}, - {"cont", "contents", 3, []protocol.BlockInfo{{3, 3, nil}, {6, 2, nil}}}, + {"contents", "cont", 3, []protocol.BlockInfo{{Offset: 3, Size: 1}}}, + {"cont", "contents", 3, []protocol.BlockInfo{{Offset: 3, Size: 3}, {Offset: 6, Size: 2}}}, } func TestDiff(t *testing.T) {