1
0
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:
V2Ray 2015-09-08 15:39:49 +02:00
parent 69bcce0b0d
commit 9371b3d080
2 changed files with 90 additions and 90 deletions

View File

@ -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
}

View File

@ -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)
}
}