Update golanci-lint

This commit is contained in:
9seconds
2021-04-09 14:35:04 +03:00
parent 81bca75c25
commit 585ebfeb50
32 changed files with 101 additions and 75 deletions
@@ -16,8 +16,8 @@ func (c *clientHandhakeFrame) decryptor(secret []byte) cipher.Stream {
hasher := acquireSha256Hasher()
defer releaseSha256Hasher(hasher)
hasher.Write(c.key()) // nolint: errcheck
hasher.Write(secret) // nolint: errcheck
hasher.Write(c.key())
hasher.Write(secret)
return makeAesCtr(hasher.Sum(nil), c.iv())
}
@@ -28,8 +28,8 @@ func (c *clientHandhakeFrame) encryptor(secret []byte) cipher.Stream {
hasher := acquireSha256Hasher()
defer releaseSha256Hasher(hasher)
hasher.Write(invertedHandshake.key()) // nolint: errcheck
hasher.Write(secret) // nolint: errcheck
hasher.Write(invertedHandshake.key())
hasher.Write(secret)
return makeAesCtr(hasher.Sum(nil), invertedHandshake.iv())
}
@@ -47,14 +47,18 @@ func (suite *ClientHandshakeTestSuite) TestOk() {
Once().
Return(len(snapshot.Decrypted.Text.data), nil).
Run(func(args mock.Arguments) {
arr := args.Get(0).([]byte)
arr, ok := args.Get(0).([]byte)
suite.True(ok)
copy(arr, snapshot.Decrypted.Cipher.data)
})
connMock.On("Write", mock.Anything).
Once().
Return(len(snapshot.Encrypted.Text.data), nil).
Run(func(args mock.Arguments) {
arr := args.Get(0).([]byte)
arr, ok := args.Get(0).([]byte)
suite.True(ok)
copy(writeData, arr)
})
+1 -1
View File
@@ -32,5 +32,5 @@ func (c Conn) Write(p []byte) (int, error) {
payload := buf.Bytes()
c.Encryptor.XORKeyStream(payload, payload)
return c.Conn.Write(payload)
return c.Conn.Write(payload) // nolint: wrapcheck
}