1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-30 05:55:20 -05:00

common.Must

This commit is contained in:
Darien Raymond
2016-12-28 00:53:29 +01:00
parent 22fa151391
commit 7c751fcca0
14 changed files with 32 additions and 31 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"io"
"v2ray.com/core/common"
"v2ray.com/core/common/buf"
"v2ray.com/core/common/serial"
)
@@ -135,9 +136,9 @@ func (v *AuthenticationReader) EnsureChunk() error {
v.buffer.Clear()
} else {
leftover := v.buffer.Bytes()
v.buffer.Reset(func(b []byte) (int, error) {
common.Must(v.buffer.Reset(func(b []byte) (int, error) {
return copy(b, leftover), nil
})
}))
}
err = v.buffer.AppendSupplier(buf.ReadFrom(v.reader))
if err == nil {