func Unmarshal(data []byte, v interface{}) error {
	e := decoder{Reader: bufio.NewReader(bytes.NewBuffer(data))}
	return e.decode(v)
}
Unmarshal the bencode value in the 'data' to a value pointed by the 'v'
pointer, return a non-nil error if any.
package bencode
import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"reflect"
)
type MarshalTypeError struct {
	Type reflect.Type
}
func (this *MarshalTypeError) Error() string {
	return "bencode: unsupported type: " + this.Type.String()
}
type UnmarshalInvalidArgError struct {
	Type reflect.Type
}
func (e *UnmarshalInvalidArgError) Error() string {
	if e.Type == nil {
		return "bencode: Unmarshal(nil)"
	}
	if e.Type.Kind() != reflect.Ptr {
		return "bencode: Unmarshal(non-pointer " + e.Type.String() + ")"
	}
	return "bencode: Unmarshal(nil " + e.Type.String() + ")"
}
type UnmarshalTypeError struct {
	Value string
	Type  reflect.Type
}
func (e *UnmarshalTypeError) Error() string {
	return "bencode: value (" + e.Value + ") is not appropriate for type: " +
		e.Type.String()
}
type UnmarshalFieldError struct {
	Key   string
	Type  reflect.Type
	Field reflect.StructField
}
func (e *UnmarshalFieldError) Error() string {
	return "bencode: key \"" + e.Key + "\" led to an unexported field \"" +
		e.Field.Name + "\" in type: " + e.Type.String()
}
type SyntaxError struct {
	Offset int64  
	What   error  
}
func (e *SyntaxError) Error() string {
	return fmt.Sprintf("bencode: syntax error (offset: %d): %s", e.Offset, e.What)
}
type MarshalerError struct {
	Type reflect.Type
	Err  error
}
func (e *MarshalerError) Error() string {
	return "bencode: error calling MarshalBencode for type " + e.Type.String() + ": " + e.Err.Error()
}
type UnmarshalerError struct {
	Type reflect.Type
	Err  error
}
func (e *UnmarshalerError) Error() string {
	return "bencode: error calling UnmarshalBencode for type " + e.Type.String() + ": " + e.Err.Error()
}
type Marshaler interface {
	MarshalBencode() ([]byte, error)
}
type Unmarshaler interface {
	UnmarshalBencode([]byte) error
}
func Marshal(v interface{}) ([]byte, error) {
	var buf bytes.Buffer
	e := encoder{Writer: bufio.NewWriter(&buf)}
	err := e.encode(v)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), nil
}