aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-07-06 21:06:42 +0200
committerJakob Unterwurzacher2016-07-06 21:06:42 +0200
commit7f3ede473e52acfb084e01a56f1e777466344fd3 (patch)
treee174d4254dc0dc1f1b06ae1948a4671270fde9f4 /tests
parent9d17fdb2068a5217ffab260db671c1cc50536e04 (diff)
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/matrix/matrix_test.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/matrix/matrix_test.go b/tests/matrix/matrix_test.go
index 3e4ecb7..b73a0cf 100644
--- a/tests/matrix/matrix_test.go
+++ b/tests/matrix/matrix_test.go
@@ -12,8 +12,6 @@ package matrix
import (
"bytes"
- "crypto/md5"
- "encoding/hex"
"flag"
"fmt"
"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)
- bin := md5.Sum(d)
- hashWant := hex.EncodeToString(bin[:])
+ hashWant := test_helpers.Md5hex(d)
hashActual := test_helpers.Md5fn(test_helpers.DefaultPlainDir + "/" + fn)
@@ -297,8 +294,7 @@ func TestAppend(t *testing.T) {
for i := 0; i <= 500; i++ {
file.Write(data)
buf.Write(data)
- bin := md5.Sum(buf.Bytes())
- hashWant = hex.EncodeToString(bin[:])
+ hashWant = test_helpers.Md5hex(buf.Bytes())
hashActual := test_helpers.Md5fn(fn)
if hashWant != hashActual {
t.FailNow()