From 120af801cf8e7562ecbb1824c89ad2d394958e96 Mon Sep 17 00:00:00 2001 From: Pauline Middelink Date: Wed, 17 May 2017 01:39:39 +0200 Subject: [PATCH] Fix golint warnings (except the exported fields/functions without comments) --- src/restic/crypto/crypto.go | 10 +++++----- src/restic/crypto/crypto_int_test.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/restic/crypto/crypto.go b/src/restic/crypto/crypto.go index 03d3d10a2..fe7d3e5f2 100644 --- a/src/restic/crypto/crypto.go +++ b/src/restic/crypto/crypto.go @@ -173,10 +173,10 @@ func (m *MACKey) UnmarshalJSON(data []byte) error { } // Valid tests whether the key k is valid (i.e. not zero). -func (k *MACKey) Valid() bool { +func (m *MACKey) Valid() bool { nonzeroK := false - for i := 0; i < len(k.K); i++ { - if k.K[i] != 0 { + for i := 0; i < len(m.K); i++ { + if m.K[i] != 0 { nonzeroK = true } } @@ -185,8 +185,8 @@ func (k *MACKey) Valid() bool { return false } - for i := 0; i < len(k.R); i++ { - if k.R[i] != 0 { + for i := 0; i < len(m.R); i++ { + if m.R[i] != 0 { return true } } diff --git a/src/restic/crypto/crypto_int_test.go b/src/restic/crypto/crypto_int_test.go index 1dbc32623..88c7b1fa7 100644 --- a/src/restic/crypto/crypto_int_test.go +++ b/src/restic/crypto/crypto_int_test.go @@ -7,7 +7,7 @@ import ( ) // test vectors from http://cr.yp.to/mac/poly1305-20050329.pdf -var poly1305_tests = []struct { +var poly1305Tests = []struct { msg []byte r []byte k []byte @@ -44,7 +44,7 @@ var poly1305_tests = []struct { } func TestPoly1305(t *testing.T) { - for _, test := range poly1305_tests { + for _, test := range poly1305Tests { key := &MACKey{} copy(key.K[:], test.k) copy(key.R[:], test.r)