diff --git a/acme/acme_test.go b/acme/acme_test.go index b44af59..89f2efa 100644 --- a/acme/acme_test.go +++ b/acme/acme_test.go @@ -946,7 +946,7 @@ func TestNonce_add(t *testing.T) { c.addNonce(http.Header{"Replay-Nonce": {}}) c.addNonce(http.Header{"Replay-Nonce": {"nonce"}}) - nonces := map[string]struct{}{"nonce": struct{}{}} + nonces := map[string]struct{}{"nonce": {}} if !reflect.DeepEqual(c.nonces, nonces) { t.Errorf("c.nonces = %q; want %q", c.nonces, nonces) } diff --git a/ocsp/ocsp.go b/ocsp/ocsp.go index 5e73146..589dfd3 100644 --- a/ocsp/ocsp.go +++ b/ocsp/ocsp.go @@ -760,7 +760,7 @@ func CreateResponse(issuer, responderCert *x509.Certificate, template Response, } if template.Certificate != nil { response.Certificates = []asn1.RawValue{ - asn1.RawValue{FullBytes: template.Certificate.Raw}, + {FullBytes: template.Certificate.Raw}, } } responseDER, err := asn1.Marshal(response) diff --git a/ocsp/ocsp_test.go b/ocsp/ocsp_test.go index 1fadfec..70b1976 100644 --- a/ocsp/ocsp_test.go +++ b/ocsp/ocsp_test.go @@ -218,7 +218,7 @@ func TestOCSPResponse(t *testing.T) { extensionBytes, _ := hex.DecodeString(ocspExtensionValueHex) extensions := []pkix.Extension{ - pkix.Extension{ + { Id: ocspExtensionOID, Critical: false, Value: extensionBytes, diff --git a/pkcs12/internal/rc2/rc2.go b/pkcs12/internal/rc2/rc2.go index 8c70902..7499e3f 100644 --- a/pkcs12/internal/rc2/rc2.go +++ b/pkcs12/internal/rc2/rc2.go @@ -122,7 +122,6 @@ func (c *rc2Cipher) Encrypt(dst, src []byte) { r3 = r3 + c.k[r2&63] for j <= 40 { - // mix r0 r0 = r0 + c.k[j] + (r3 & r2) + ((^r3) & r1) r0 = rotl16(r0, 1) @@ -151,7 +150,6 @@ func (c *rc2Cipher) Encrypt(dst, src []byte) { r3 = r3 + c.k[r2&63] for j <= 60 { - // mix r0 r0 = r0 + c.k[j] + (r3 & r2) + ((^r3) & r1) r0 = rotl16(r0, 1) @@ -244,7 +242,6 @@ func (c *rc2Cipher) Decrypt(dst, src []byte) { r0 = r0 - c.k[r3&63] for j >= 0 { - // unmix r3 r3 = rotl16(r3, 16-5) r3 = r3 - c.k[j] - (r2 & r1) - ((^r2) & r0) diff --git a/pkcs12/internal/rc2/rc2_test.go b/pkcs12/internal/rc2/rc2_test.go index 8a49dfa..51a7efe 100644 --- a/pkcs12/internal/rc2/rc2_test.go +++ b/pkcs12/internal/rc2/rc2_test.go @@ -11,7 +11,6 @@ import ( ) func TestEncryptDecrypt(t *testing.T) { - // TODO(dgryski): add the rest of the test vectors from the RFC var tests = []struct { key string diff --git a/sha3/sha3_test.go b/sha3/sha3_test.go index 312e8f9..2c8719b 100644 --- a/sha3/sha3_test.go +++ b/sha3/sha3_test.go @@ -202,7 +202,7 @@ func TestSqueezing(t *testing.T) { d1 := newShakeHash() d1.Write([]byte(testString)) var multiple []byte - for _ = range ref { + for range ref { one := make([]byte, 1) d1.Read(one) multiple = append(multiple, one...) diff --git a/ssh/certs.go b/ssh/certs.go index b1f0220..5c9fadc 100644 --- a/ssh/certs.go +++ b/ssh/certs.go @@ -343,7 +343,7 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { return fmt.Errorf("ssh: certicate serial %d revoked", cert.Serial) } - for opt, _ := range cert.CriticalOptions { + for opt := range cert.CriticalOptions { // sourceAddressCriticalOption will be enforced by // serverAuthenticate if opt == sourceAddressCriticalOption { diff --git a/ssh/session.go b/ssh/session.go index cc06e03..d3321f6 100644 --- a/ssh/session.go +++ b/ssh/session.go @@ -406,7 +406,7 @@ func (s *Session) Wait() error { s.stdinPipeWriter.Close() } var copyError error - for _ = range s.copyFuncs { + for range s.copyFuncs { if err := <-s.errors; err != nil && copyError == nil { copyError = err } diff --git a/ssh/test/banner_test.go b/ssh/test/banner_test.go index f1ad469..d3b21ac 100644 --- a/ssh/test/banner_test.go +++ b/ssh/test/banner_test.go @@ -8,7 +8,6 @@ package test import ( "testing" - ) func TestBannerCallbackAgainstOpenSSH(t *testing.T) {