swarm: fix megacheck warnings

This commit is contained in:
Egon Elbre
2017-08-08 20:34:35 +03:00
parent 6ca59d98f8
commit 133de3d806
18 changed files with 39 additions and 108 deletions

View File

@ -43,13 +43,6 @@ type chunkerTester struct {
t test
}
func (self *chunkerTester) checkChunks(t *testing.T, want int) {
l := len(self.chunks)
if l != want {
t.Errorf("expected %v chunks, got %v", want, l)
}
}
func (self *chunkerTester) Split(chunker Splitter, data io.Reader, size int64, chunkC chan *Chunk, swg *sync.WaitGroup, expectedError error) (key Key) {
// reset
self.chunks = make(map[string]*Chunk)
@ -209,20 +202,6 @@ func TestRandomBrokenData(t *testing.T) {
}
}
func readAll(reader LazySectionReader, result []byte) {
size := int64(len(result))
var end int64
for pos := int64(0); pos < size; pos += 1000 {
if pos+1000 > size {
end = size
} else {
end = pos + 1000
}
reader.ReadAt(result[pos:end], pos)
}
}
func benchReadAll(reader LazySectionReader) {
size, _ := reader.Size(nil)
output := make([]byte, 1000)