development: use golangci-lint

This commit is contained in:
Bobby DeSimone 2019-07-13 18:28:51 -07:00
parent ab94b49ca6
commit b85f8de05f
No known key found for this signature in database
GPG key ID: AEE4CF12FE86D07E
35 changed files with 292 additions and 115 deletions

View file

@ -89,7 +89,7 @@ func (c *XChaCha20Cipher) Encrypt(plaintext []byte) (joined []byte, err error) {
ciphertext := c.aead.Seal(nil, nonce, plaintext, nil)
// we return the nonce as part of the returned value
joined = append(ciphertext[:], nonce[:]...)
joined = append(ciphertext, nonce...)
return joined, nil
}

View file

@ -14,7 +14,7 @@ func TestEncodeAndDecodeAccessToken(t *testing.T) {
plaintext := []byte("my plain text value")
key := GenerateKey()
c, err := NewCipher([]byte(key))
c, err := NewCipher(key)
if err != nil {
t.Fatalf("unexpected err: %v", err)
}
@ -43,7 +43,7 @@ func TestEncodeAndDecodeAccessToken(t *testing.T) {
func TestMarshalAndUnmarshalStruct(t *testing.T) {
key := GenerateKey()
c, err := NewCipher([]byte(key))
c, err := NewCipher(key)
if err != nil {
t.Fatalf("unexpected err: %v", err)
}