mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 06:31:57 +00:00
Unreader to unread bytes
This commit is contained in:
+3
-2
@@ -123,8 +123,9 @@ func GreeterEncoder(o interface{}, w io.Writer, n *int64, err *error) {
|
||||
}
|
||||
}
|
||||
|
||||
func GreeterDecoder(r io.Reader, n *int64, err *error) interface{} {
|
||||
switch t := ReadByte(r, n, err); t {
|
||||
func GreeterDecoder(r *bytes.Reader, n *int64, err *error) interface{} {
|
||||
// We must peek the type byte because ReadBinary() expects it.
|
||||
switch t := PeekByte(r, n, err); t {
|
||||
case GreeterTypeDog:
|
||||
return ReadBinary(Dog{}, r, n, err)
|
||||
case GreeterTypeCat:
|
||||
|
||||
Reference in New Issue
Block a user