good morning!!!!

Skip to content
Snippets Groups Projects
Commit b94a6a01 authored by Felix Lange's avatar Felix Lange
Browse files

rlp: add DecodeBytes

Über-convenience.
parent cb009a5c
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ package rlp
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
......@@ -73,6 +74,12 @@ func Decode(r io.Reader, val interface{}) error {
return NewStream(r).Decode(val)
}
// DecodeBytes parses RLP data from b into val.
// Please see the documentation of Decode for the decoding rules.
func DecodeBytes(b []byte, val interface{}) error {
return NewStream(bytes.NewReader(b)).Decode(val)
}
type decodeError struct {
msg string
typ reflect.Type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment