From 7f3ede473e52acfb084e01a56f1e777466344fd3 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 6 Jul 2016 21:06:42 +0200 Subject: [PATCH] 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. --- tests/matrix/matrix_test.go | 8 ++------ 1 file 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()