func (c *Codec) Unmarshal(avro []byte, output interface{}) error {
	return c.unmarshal(&c.Codec, avro, output)
}
Unmarshal unmarshals any go type from avro
package avro
import (
	"encoding/json"
	"reflect"
	"strings"
	"github.com/fatih/camelcase"
	"github.com/leboncoin/structs"
	"github.com/linkedin/goavro/v2"
	"github.com/mitchellh/mapstructure"
)
type TypeNameEncoder func(name string) string
func CamelCaseToSnakeCase(name string) string {
	result := camelcase.Split(name)
	for i, s := range result {
		result[i] = strings.ToLower(s)
	}
	return strings.Join(result, "_")
}
var typeConversion = map[string]string{
	"uint8":   "int",
	"uint16":  "int",
	"uint32":  "int",
	"int8":    "int",
	"int16":   "int",
	"int32":   "int",
	"rune":    "int",
	"uint":    "long",
	"int":     "long",
	"uint64":  "long",
	"int64":   "long",
	"float32": "float",
	"float64": "double",
	"bool":    "boolean",
}
var avroBaseTypes = []string{
	"null",
	"boolean",
	"int",
	"long",
	"float",
	"double",
	"bytes",
	"string",
}
func GoToAvroType(name string) string {
	out, ok := typeConversion[name]
	if !ok {
		return name
	}
	return out
}
func DefaultTypeNameEncoder(name string) string {
	return CamelCaseToSnakeCase(GoToAvroType(name))
}
func AddNamespace(namespace, typeName string) string {
	if len(namespace) == 0 {
		return typeName
	}
	return namespace + "." + typeName
}
type avroSchemaNamespace struct {
	Namespace string `json:"namespace,omitempty"`
}
type TypeNamer interface {
	AvroName() string
}
type CustomUnmarshaler interface {
	UnmarshalAvro(b []byte) error
}
type Marshaler interface {
	Marshal(interface{}) ([]byte, error)
}
type Unmarshaler interface {
	Unmarshal([]byte, interface{}) error
}
type Codec struct {
	goavro.Codec
	Namespace string
	TypeNameEncoder TypeNameEncoder
}
func NewCodec(schemaSpecification string) (*Codec, error) {
	o, err := goavro.NewCodec(schemaSpecification)
	if err != nil {
		return nil, err
	}
	namespaceStruct := avroSchemaNamespace{}
	err = json.Unmarshal([]byte(schemaSpecification), &namespaceStruct)
	var namespace string
	if err != nil {
		namespace = ""
	} else {
		namespace = namespaceStruct.Namespace
	}
	return &Codec{*o, namespace, DefaultTypeNameEncoder}, nil
}
func (c *Codec) Marshal(st interface{}) ([]byte, error) {
	return c.marshal(&c.Codec, st)
}