tests: fix shadow warning

"go tool vet -shadow=true" complained about the md5 package
being shadowed by variables called "md5".
Fix by using the Md5hex helper and dropping the md5 import.
This commit is contained in:
Jakob Unterwurzacher 2016-07-06 21:06:42 +02:00
parent 9d17fdb206
commit 7f3ede473e

View File

@ -12,8 +12,6 @@ package matrix
import ( import (
"bytes" "bytes"
"crypto/md5"
"encoding/hex"
"flag" "flag"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
@ -75,8 +73,7 @@ func testWriteN(t *testing.T, fn string, n int) string {
test_helpers.VerifySize(t, test_helpers.DefaultPlainDir+"/"+fn, n) test_helpers.VerifySize(t, test_helpers.DefaultPlainDir+"/"+fn, n)
bin := md5.Sum(d) hashWant := test_helpers.Md5hex(d)
hashWant := hex.EncodeToString(bin[:])
hashActual := test_helpers.Md5fn(test_helpers.DefaultPlainDir + "/" + fn) hashActual := test_helpers.Md5fn(test_helpers.DefaultPlainDir + "/" + fn)
@ -297,8 +294,7 @@ func TestAppend(t *testing.T) {
for i := 0; i <= 500; i++ { for i := 0; i <= 500; i++ {
file.Write(data) file.Write(data)
buf.Write(data) buf.Write(data)
bin := md5.Sum(buf.Bytes()) hashWant = test_helpers.Md5hex(buf.Bytes())
hashWant = hex.EncodeToString(bin[:])
hashActual := test_helpers.Md5fn(fn) hashActual := test_helpers.Md5fn(fn)
if hashWant != hashActual { if hashWant != hashActual {
t.FailNow() t.FailNow()