2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 00:33:57 +00:00

Fix golint warnings

(except the exported fields/functions without comments)
This commit is contained in:
Pauline Middelink 2017-05-17 01:39:39 +02:00
parent f3d09ce7c8
commit 120af801cf
2 changed files with 7 additions and 7 deletions

View File

@ -173,10 +173,10 @@ func (m *MACKey) UnmarshalJSON(data []byte) error {
} }
// Valid tests whether the key k is valid (i.e. not zero). // Valid tests whether the key k is valid (i.e. not zero).
func (k *MACKey) Valid() bool { func (m *MACKey) Valid() bool {
nonzeroK := false nonzeroK := false
for i := 0; i < len(k.K); i++ { for i := 0; i < len(m.K); i++ {
if k.K[i] != 0 { if m.K[i] != 0 {
nonzeroK = true nonzeroK = true
} }
} }
@ -185,8 +185,8 @@ func (k *MACKey) Valid() bool {
return false return false
} }
for i := 0; i < len(k.R); i++ { for i := 0; i < len(m.R); i++ {
if k.R[i] != 0 { if m.R[i] != 0 {
return true return true
} }
} }

View File

@ -7,7 +7,7 @@ import (
) )
// test vectors from http://cr.yp.to/mac/poly1305-20050329.pdf // test vectors from http://cr.yp.to/mac/poly1305-20050329.pdf
var poly1305_tests = []struct { var poly1305Tests = []struct {
msg []byte msg []byte
r []byte r []byte
k []byte k []byte
@ -44,7 +44,7 @@ var poly1305_tests = []struct {
} }
func TestPoly1305(t *testing.T) { func TestPoly1305(t *testing.T) {
for _, test := range poly1305_tests { for _, test := range poly1305Tests {
key := &MACKey{} key := &MACKey{}
copy(key.K[:], test.k) copy(key.K[:], test.k)
copy(key.R[:], test.r) copy(key.R[:], test.r)