mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-30 05:56:54 -05:00
format code
This commit is contained in:
parent
69bcce0b0d
commit
9371b3d080
@ -26,7 +26,7 @@ func NewDecryptionReader(reader io.Reader, key []byte) (*DecryptionReader, error
|
||||
}
|
||||
decryptionReader.cipher = cipher
|
||||
decryptionReader.reader = reader
|
||||
decryptionReader.buffer = bytes.NewBuffer(make([]byte, 0, 2 * blockSize))
|
||||
decryptionReader.buffer = bytes.NewBuffer(make([]byte, 0, 2*blockSize))
|
||||
return decryptionReader, nil
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,10 @@ func TestNormalReading(t *testing.T) {
|
||||
readSize := 0
|
||||
for readSize < testSize {
|
||||
nBytes := mrand.Intn(16) + 1
|
||||
if nBytes > testSize - readSize {
|
||||
if nBytes > testSize-readSize {
|
||||
nBytes = testSize - readSize
|
||||
}
|
||||
bytesRead, err := reader.Read(readtext[readSize:readSize + nBytes])
|
||||
bytesRead, err := reader.Read(readtext[readSize : readSize+nBytes])
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -61,7 +61,7 @@ func TestNormalReading(t *testing.T) {
|
||||
}
|
||||
readSize += nBytes
|
||||
}
|
||||
if ! bytes.Equal(readtext, plaintext) {
|
||||
if !bytes.Equal(readtext, plaintext) {
|
||||
t.Errorf("Expected plaintext %v, but got %v", plaintext, readtext)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user