Repository: hamba/avro
Pull request #237 (2023-02-16 19:03:17)

chore: switch from interface{} to any


Patch:
diff --git a/README.md b/README.md
index 7196c21..b3c615c 100644
--- a/README.md
+++ b/README.md
@@ -78,11 +78,11 @@ More examples in the [godoc](https://godoc.org/github.com/hamba/avro).
 | `long`                  | `int64`, `uint32`\*                                    | `int64`, `uint32`        |
 | `int`                   | `int`, `int32`, `int16`, `int8`, `uint8`\*, `uint16`\* | `int`, `uint8`, `uint16` |
 | `string`                | `string`                                               | `string`                 |
-| `array`                 | `[]T`                                                  | `[]interface{}`          |
+| `array`                 | `[]T`                                                  | `[]any`          |
 | `enum`                  | `string`                                               | `string`                 |
 | `fixed`                 | `[n]byte`                                              | `[]byte`                 |
-| `map`                   | `map[string]T{}`                                       | `map[string]interface{}` |
-| `record`                | `struct`                                               | `map[string]interface{}` |
+| `map`                   | `map[string]T{}`                                       | `map[string]any` |
+| `record`                | `struct`                                               | `map[string]any` |
 | `union`                 | *see below*                                            | *see below*              |
 | `int.date`              | `time.Time`                                            | `time.Time`              |
 | `int.time-millis`       | `time.Duration`                                        | `time.Duration`          |
@@ -99,15 +99,15 @@ are larger than the Go type `uint8 = 0`.
 
 ##### Unions
 
-The following union types are accepted: `map[string]interface{}`, `*T` and `interface{}`.
+The following union types are accepted: `map[string]any`, `*T` and `any`.
 
-* **map[string]interface{}:** If the union value is `nil`, a `nil` map will be en/decoded. 
+* **map[string]any:** If the union value is `nil`, a `nil` map will be en/decoded. 
 When a non-`nil` union value is encountered, a single key is en/decoded. The key is the avro
 type name, or scheam full name in the case of a named schema (enum, fixed or record).
 * ***T:** This is allowed in a "nullable" union. A nullable union is defined as a two schema union, 
 with one of the types being `null` (ie. `["null", "string"]` or `["string", "null"]`), in this case 
 a `*T` is allowed, with `T` matching the conversion table above.
-* **interface{}:** An `interface` can be provided and the type or name resolved. Primitive types
+* **any:** An `interface` can be provided and the type or name resolved. Primitive types
 are pre-registered, but named types, maps and slices will need to be registered with the `Register` function. 
 In the case of arrays and maps the enclosed schema type or name is postfix to the type with a `:` separator, 
 e.g `"map:string"`. Behavior when a type cannot be resolved will depend on your chosen configuation options:
diff --git a/codec.go b/codec.go
index 9393269..940063d 100644
--- a/codec.go
+++ b/codec.go
@@ -33,7 +33,7 @@ type ValEncoder interface {
 }
 
 // ReadVal parses Avro value and stores the result in the value pointed to by obj.
-func (r *Reader) ReadVal(schema Schema, obj interface{}) {
+func (r *Reader) ReadVal(schema Schema, obj any) {
 	decoder := r.cfg.getDecoderFromCache(schema.Fingerprint(), reflect2.RTypeOf(obj))
 	if decoder == nil {
 		typ := reflect2.TypeOf(obj)
@@ -54,7 +54,7 @@ func (r *Reader) ReadVal(schema Schema, obj interface{}) {
 }
 
 // WriteVal writes the Avro encoding of obj.
-func (w *Writer) WriteVal(schema Schema, val interface{}) {
+func (w *Writer) WriteVal(schema Schema, val any) {
 	encoder := w.cfg.getEncoderFromCache(schema.Fingerprint(), reflect2.RTypeOf(val))
 	if encoder == nil {
 		typ := reflect2.TypeOf(val)
diff --git a/codec_dynamic.go b/codec_dynamic.go
index e092333..631b0d5 100644
--- a/codec_dynamic.go
+++ b/codec_dynamic.go
@@ -12,7 +12,7 @@ type efaceDecoder struct {
 }
 
 func (d *efaceDecoder) Decode(ptr unsafe.Pointer, r *Reader) {
-	pObj := (*interface{})(ptr)
+	pObj := (*any)(ptr)
 	obj := *pObj
 	if obj == nil {
 		*pObj = r.ReadNext(d.schema)
diff --git a/codec_enum.go b/codec_enum.go
index 8476bf8..0fdb73a 100644
--- a/codec_enum.go
+++ b/codec_enum.go
@@ -79,7 +79,7 @@ func (c *enumTextMarshalerCodec) Decode(ptr unsafe.Pointer, r *Reader) {
 		return
 	}
 
-	var obj interface{}
+	var obj any
 	if c.ptr {
 		obj = c.typ.PackEFace(ptr)
 	} else {
@@ -98,7 +98,7 @@ func (c *enumTextMarshalerCodec) Decode(ptr unsafe.Pointer, r *Reader) {
 }
 
 func (c *enumTextMarshalerCodec) Encode(ptr unsafe.Pointer, w *Writer) {
-	var obj interface{}
+	var obj any
 	if c.ptr {
 		obj = c.typ.PackEFace(ptr)
 	} else {
diff --git a/codec_record.go b/codec_record.go
index 9109357..5650dfc 100644
--- a/codec_record.go
+++ b/codec_record.go
@@ -291,7 +291,7 @@ func encoderOfRecord(cfg *frozenConfig, schema Schema, typ reflect2.Type) ValEnc
 			switch {
 			case field.Type().Type() == Union:
 				union := field.Type().(*UnionSchema)
-				fields[i].def = map[string]interface{}{
+				fields[i].def = map[string]any{
 					string(union.Types()[0].Type()): field.Default(),
 				}
 			case field.Default() == nil:
@@ -315,7 +315,7 @@ func encoderOfRecord(cfg *frozenConfig, schema Schema, typ reflect2.Type) ValEnc
 type mapEncoderField struct {
 	name       string
 	hasDef     bool
-	def        interface{}
+	def        any
 	defEncoder ValEncoder
 	encoder    ValEncoder
 }
diff --git a/codec_union.go b/codec_union.go
index efb97b2..d07cbf0 100644
--- a/codec_union.go
+++ b/codec_union.go
@@ -116,7 +116,7 @@ type mapUnionEncoder struct {
 }
 
 func (e *mapUnionEncoder) Encode(ptr unsafe.Pointer, w *Writer) {
-	m := *((*map[string]interface{})(ptr))
+	m := *((*map[string]any)(ptr))
 
 	if len(m) > 1 {
 		w.Error = errors.New("avro: cannot encode union map with multiple entries")
@@ -124,7 +124,7 @@ func (e *mapUnionEncoder) Encode(ptr unsafe.Pointer, w *Writer) {
 	}
 
 	name := "null"
-	val := interface{}(nil)
+	val := any(nil)
 	for k, v := range m {
 		name = k
 		val = v
@@ -278,7 +278,7 @@ func (d *unionResolvedDecoder) Decode(ptr unsafe.Pointer, r *Reader) {
 		return
 	}
 
-	pObj := (*interface{})(ptr)
+	pObj := (*any)(ptr)
 
 	if schema.Type() == Null {
 		*pObj = nil
@@ -293,7 +293,7 @@ func (d *unionResolvedDecoder) Decode(ptr unsafe.Pointer, r *Reader) {
 
 		// We cannot resolve this, set it to the map type
 		name := schemaTypeName(schema)
-		obj := map[string]interface{}{}
+		obj := map[string]any{}
 		obj[name] = r.ReadNext(schema)
 
 		*pObj = obj
diff --git a/config.go b/config.go
index 2b0b664..a5e79cd 100644
--- a/config.go
+++ b/config.go
@@ -46,7 +46,7 @@ func (c Config) Freeze() API {
 	}
 
 	api.readerPool = &sync.Pool{
-		New: func() interface{} {
+		New: func() any {
 			return &Reader{
 				cfg:    api,
 				reader: nil,
@@ -57,7 +57,7 @@ func (c Config) Freeze() API {
 		},
 	}
 	api.writerPool = &sync.Pool{
-		New: func() interface{} {
+		New: func() any {
 			return &Writer{
 				cfg:   api,
 				out:   nil,
@@ -73,11 +73,11 @@ func (c Config) Freeze() API {
 // API represents a frozen Config.
 type API interface {
 	// Marshal returns the Avro encoding of v.
-	Marshal(schema Schema, v interface{}) ([]byte, error)
+	Marshal(schema Schema, v any) ([]byte, error)
 
 	// Unmarshal parses the Avro encoded data and stores the result in the value pointed to by v.
 	// If v is nil or not a pointer, Unmarshal returns an error.
-	Unmarshal(schema Schema, data []byte, v interface{}) error
+	Unmarshal(schema Schema, data []byte, v any) error
 
 	// NewEncoder returns a new encoder that writes to w using schema.
 	NewEncoder(schema Schema, w io.Writer) *Encoder
@@ -92,7 +92,7 @@ type API interface {
 	EncoderOf(schema Schema, tpy reflect2.Type) ValEncoder
 
 	// Register registers names to their types for resolution. All primitive types are pre-registered.
-	Register(name string, obj interface{})
+	Register(name string, obj any)
 }
 
 type frozenConfig struct {
@@ -107,7 +107,7 @@ type frozenConfig struct {
 	resolver *TypeResolver
 }
 
-func (c *frozenConfig) Marshal(schema Schema, v interface{}) ([]byte, error) {
+func (c *frozenConfig) Marshal(schema Schema, v any) ([]byte, error) {
 	writer := c.borrowWriter()
 
 	writer.WriteVal(schema, v)
@@ -137,7 +137,7 @@ func (c *frozenConfig) returnWriter(writer *Writer) {
 	c.writerPool.Put(writer)
 }
 
-func (c *frozenConfig) Unmarshal(schema Schema, data []byte, v interface{}) error {
+func (c *frozenConfig) Unmarshal(schema Schema, data []byte, v any) error {
 	reader := c.borrowReader(data)
 
 	reader.ReadVal(schema, v)
@@ -181,7 +181,7 @@ func (c *frozenConfig) NewDecoder(schema Schema, r io.Reader) *Decoder {
 	}
 }
 
-func (c *frozenConfig) Register(name string, obj interface{}) {
+func (c *frozenConfig) Register(name string, obj any) {
 	c.resolver.Register(name, obj)
 }
 
diff --git a/decoder.go b/decoder.go
index fc8f32f..a3c72ad 100644
--- a/decoder.go
+++ b/decoder.go
@@ -27,7 +27,7 @@ func NewDecoderForSchema(schema Schema, reader io.Reader) *Decoder {
 }
 
 // Decode reads the next Avro encoded value from its input and stores it in the value pointed to by v.
-func (d *Decoder) Decode(obj interface{}) error {
+func (d *Decoder) Decode(obj any) error {
 	if d.r.head == d.r.tail && d.r.reader != nil {
 		if !d.r.loadMore() {
 			return io.EOF
@@ -45,6 +45,6 @@ func (d *Decoder) Decode(obj interface{}) error {
 
 // Unmarshal parses the Avro encoded data and stores the result in the value pointed to by v.
 // If v is nil or not a pointer, Unmarshal returns an error.
-func Unmarshal(schema Schema, data []byte, v interface{}) error {
+func Unmarshal(schema Schema, data []byte, v any) error {
 	return DefaultConfig.Unmarshal(schema, data, v)
 }
diff --git a/encoder.go b/encoder.go
index 3e29122..faa285e 100644
--- a/encoder.go
+++ b/encoder.go
@@ -25,13 +25,13 @@ func NewEncoderForSchema(schema Schema, w io.Writer) *Encoder {
 }
 
 // Encode writes the Avro encoding of v to the stream.
-func (e *Encoder) Encode(v interface{}) error {
+func (e *Encoder) Encode(v any) error {
 	e.w.WriteVal(e.s, v)
 	_ = e.w.Flush()
 	return e.w.Error
 }
 
 // Marshal returns the Avro encoding of v.
-func Marshal(schema Schema, v interface{}) ([]byte, error) {
+func Marshal(schema Schema, v any) ([]byte, error) {
 	return DefaultConfig.Marshal(schema, v)
 }
diff --git a/gen/gen.go b/gen/gen.go
index 4a54038..2619182 100644
--- a/gen/gen.go
+++ b/gen/gen.go
@@ -199,7 +199,7 @@ func (g *Generator) resolveUnionTypes(s *avro.UnionSchema) string {
 	if s.Nullable() {
 		return "*" + types[0]
 	}
-	return "interface{}"
+	return "any"
 }
 
 func (g *Generator) resolveLogicalSchema(logicalType avro.LogicalType) string {
diff --git a/ocf/ocf.go b/ocf/ocf.go
index 7730b47..7026afc 100644
--- a/ocf/ocf.go
+++ b/ocf/ocf.go
@@ -96,7 +96,7 @@ func (d *Decoder) HasNext() bool {
 }
 
 // Decode reads the next Avro encoded value from its input and stores it in the value pointed to by v.
-func (d *Decoder) Decode(v interface{}) error {
+func (d *Decoder) Decode(v any) error {
 	if d.count <= 0 {
 		return errors.New("decoder: no data found, call HasNext first")
 	}
@@ -309,7 +309,7 @@ func (e *Encoder) Write(p []byte) (n int, err error) {
 }
 
 // Encode writes the Avro encoding of v to the stream.
-func (e *Encoder) Encode(v interface{}) error {
+func (e *Encoder) Encode(v any) error {
 	if err := e.encoder.Encode(v); err != nil {
 		return err
 	}
diff --git a/protocol.go b/protocol.go
index a0c0dba..ce2a73f 100644
--- a/protocol.go
+++ b/protocol.go
@@ -18,7 +18,7 @@ var (
 
 type protocolConfig struct {
 	doc   string
-	props map[string]interface{}
+	props map[string]any
 }
 
 // ProtocolOption is a function that sets a protocol option.
@@ -32,7 +32,7 @@ func WithProtoDoc(doc string) ProtocolOption {
 }
 
 // WithProtoProps sets the properties on a protocol.
-func WithProtoProps(props map[string]interface{}) ProtocolOption {
+func WithProtoProps(props map[string]any) ProtocolOption {
 	return func(opts *protocolConfig) {
 		opts.props = props
 	}
@@ -220,7 +220,7 @@ func MustParseProtocol(protocol string) *Protocol {
 func ParseProtocol(protocol string) (*Protocol, error) {
 	cache := &SchemaCache{}
 
-	var m map[string]interface{}
+	var m map[string]any
 	if err := jsoniter.Unmarshal([]byte(protocol), &m); err != nil {
 		return nil, err
 	}
@@ -228,15 +228,15 @@ func ParseProtocol(protocol string) (*Protocol, error) {
 }
 
 type protocol struct {
-	Protocol  string                            `mapstructure:"protocol"`
-	Namespace string                            `mapstructure:"namespace"`
-	Doc       string                            `mapstructure:"doc"`
-	Types     []interface{}                     `mapstructure:"types"`
-	Messages  map[string]map[string]interface{} `mapstructure:"messages"`
-	Props     map[string]interface{}            `mapstructure:",remain"`
+	Protocol  string                    `mapstructure:"protocol"`
+	Namespace string                    `mapstructure:"namespace"`
+	Doc       string                    `mapstructure:"doc"`
+	Types     []any                     `mapstructure:"types"`
+	Messages  map[string]map[string]any `mapstructure:"messages"`
+	Props     map[string]any            `mapstructure:",remain"`
 }
 
-func parseProtocol(m map[string]interface{}, cache *SchemaCache) (*Protocol, error) {
+func parseProtocol(m map[string]any, cache *SchemaCache) (*Protocol, error) {
 	var (
 		p    protocol
 		meta mapstructure.Metadata
@@ -275,7 +275,7 @@ func parseProtocol(m map[string]interface{}, cache *SchemaCache) (*Protocol, err
 	return NewProtocol(p.Protocol, p.Namespace, types, messages, WithProtoDoc(p.Doc), WithProtoProps(p.Props))
 }
 
-func parseProtocolTypes(namespace string, types []interface{}, cache *SchemaCache) ([]NamedSchema, error) {
+func parseProtocolTypes(namespace string, types []any, cache *SchemaCache) ([]NamedSchema, error) {
 	ts := make([]NamedSchema, len(types))
 	for i, typ := range types {
 		schema, err := parseType(namespace, typ, cache)
@@ -295,15 +295,15 @@ func parseProtocolTypes(namespace string, types []interface{}, cache *SchemaCach
 }
 
 type message struct {
-	Doc      string                   `mapstructure:"doc"`
-	Request  []map[string]interface{} `mapstructure:"request"`
-	Response interface{}              `mapstructure:"response"`
-	Errors   []interface{}            `mapstructure:"errors"`
-	OneWay   bool                     `mapstructure:"one-way"`
-	Props    map[string]interface{}   `mapstructure:",remain"`
+	Doc      string           `mapstructure:"doc"`
+	Request  []map[string]any `mapstructure:"request"`
+	Response any              `mapstructure:"response"`
+	Errors   []any            `mapstructure:"errors"`
+	OneWay   bool             `mapstructure:"one-way"`
+	Props    map[string]any   `mapstructure:",remain"`
 }
 
-func parseMessage(namespace string, m map[string]interface{}, cache *SchemaCache) (*Message, error) {
+func parseMessage(namespace string, m map[string]any, cache *SchemaCache) (*Message, error) {
 	var (
 		msg  message
 		meta mapstructure.Metadata
diff --git a/reader_generic.go b/reader_generic.go
index ab58e88..09c69b9 100644
--- a/reader_generic.go
+++ b/reader_generic.go
@@ -6,7 +6,7 @@ import (
 )
 
 // ReadNext reads the next Avro element as a generic interface.
-func (r *Reader) ReadNext(schema Schema) interface{} {
+func (r *Reader) ReadNext(schema Schema) any {
 	var ls LogicalSchema
 	lts, ok := schema.(LogicalTypeSchema)
 	if ok {
@@ -63,7 +63,7 @@ func (r *Reader) ReadNext(schema Schema) interface{} {
 		return r.ReadBytes()
 	case Record:
 		fields := schema.(*RecordSchema).Fields()
-		obj := make(map[string]interface{}, len(fields))
+		obj := make(map[string]any, len(fields))
 		for _, field := range fields {
 			obj[field.Name()] = r.ReadNext(field.Type())
 		}
@@ -79,7 +79,7 @@ func (r *Reader) ReadNext(schema Schema) interface{} {
 		}
 		return symbols[idx]
 	case Array:
-		arr := []interface{}{}
+		arr := []any{}
 		r.ReadArrayCB(func(r *Reader) bool {
 			elem := r.ReadNext(schema.(*ArraySchema).Items())
 			arr = append(arr, elem)
@@ -87,7 +87,7 @@ func (r *Reader) ReadNext(schema Schema) interface{} {
 		})
 		return arr
 	case Map:
-		obj := map[string]interface{}{}
+		obj := map[string]any{}
 		r.ReadMapCB(func(r *Reader, field string) bool {
 			elem := r.ReadNext(schema.(*MapSchema).Values())
 			obj[field] = elem
@@ -107,7 +107,7 @@ func (r *Reader) ReadNext(schema Schema) interface{} {
 		}
 
 		key := schemaTypeName(schema)
-		obj := map[string]interface{}{}
+		obj := map[string]any{}
 		obj[key] = r.ReadNext(types[idx])
 		return obj
 	case Fixed:
diff --git a/registry/client.go b/registry/client.go
index 5d611e2..20cb654 100644
--- a/registry/client.go
+++ b/registry/client.go
@@ -354,7 +354,7 @@ func (c *Client) GetCompatibilityLevel(ctx context.Context, subject string) (str
 	return resp.Compatibility, nil
 }
 
-func (c *Client) request(ctx context.Context, method, path string, in, out interface{}) error {
+func (c *Client) request(ctx context.Context, method, path string, in, out any) error {
 	var body io.Reader
 	if in != nil {
 		b, _ := jsoniter.Marshal(in)
diff --git a/resolver.go b/resolver.go
index 42f2196..a55aa02 100644
--- a/resolver.go
+++ b/resolver.go
@@ -45,7 +45,7 @@ func NewTypeResolver() *TypeResolver {
 }
 
 // Register registers names to their types for resolution.
-func (r *TypeResolver) Register(name string, obj interface{}) {
+func (r *TypeResolver) Register(name string, obj any) {
 	typ := reflect2.TypeOf(obj)
 	rtype := typ.RType()
 
@@ -83,6 +83,6 @@ func (r *TypeResolver) Type(name string) (reflect2.Type, error) {
 }
 
 // Register registers names to their types for resolution. All primitive types are pre-registered.
-func Register(name string, obj interface{}) {
+func Register(name string, obj any) {
 	DefaultConfig.Register(name, obj)
 }
diff --git a/schema.go b/schema.go
index 88139ef..7a1af6c 100644
--- a/schema.go
+++ b/schema.go
@@ -149,7 +149,7 @@ type LogicalSchema interface {
 // PropertySchema represents a schema with properties.
 type PropertySchema interface {
 	// Prop gets a property from the schema.
-	Prop(string) interface{}
+	Prop(string) any
 }
 
 // NamedSchema represents a schema with a name.
@@ -282,11 +282,11 @@ func (f *fingerprinter) FingerprintUsing(typ FingerprintType, stringer fmt.Strin
 }
 
 type properties struct {
-	props map[string]interface{}
+	props map[string]any
 }
 
-func newProperties(props map[string]interface{}, res []string) properties {
-	p := properties{props: map[string]interface{}{}}
+func newProperties(props map[string]any, res []string) properties {
+	p := properties{props: map[string]any{}}
 	for k, v := range props {
 		if isReserved(res, k) {
 			continue
@@ -306,7 +306,7 @@ func isReserved(res []string, k string) bool {
 }
 
 // Prop gets a property from the schema.
-func (p properties) Prop(name string) interface{} {
+func (p properties) Prop(name string) any {
 	if p.props == nil {
 		return nil
 	}
@@ -317,9 +317,9 @@ func (p properties) Prop(name string) interface{} {
 type schemaConfig struct {
 	aliases []string
 	doc     string
-	def     interface{}
+	def     any
 	order   Order
-	props   map[string]interface{}
+	props   map[string]any
 }
 
 // SchemaOption is a function that sets a schema option.
@@ -340,7 +340,7 @@ func WithDoc(doc string) SchemaOption {
 }
 
 // WithDefault sets the default on a schema.
-func WithDefault(def interface{}) SchemaOption {
+func WithDefault(def any) SchemaOption {
 	return func(opts *schemaConfig) {
 		opts.def = def
 	}
@@ -354,7 +354,7 @@ func WithOrder(order Order) SchemaOption {
 }
 
 // WithProps sets the properties on a schema.
-func WithProps(props map[string]interface{}) SchemaOption {
+func WithProps(props map[string]any) SchemaOption {
 	return func(opts *schemaConfig) {
 		opts.props = props
 	}
@@ -541,7 +541,7 @@ type Field struct {
 	doc     string
 	typ     Schema
 	hasDef  bool
-	def     interface{}
+	def     any
 	order   Order
 }
 
@@ -618,7 +618,7 @@ func (f *Field) HasDefault() bool {
 // Default returns the default of a field or nil.
 //
 // The only time a nil default is valid is for a Null Type.
-func (f *Field) Default() interface{} {
+func (f *Field) Default() any {
 	if f.def == nullDefault {
 		return nil
 	}
@@ -652,7 +652,7 @@ func (f *Field) MarshalJSON() ([]byte, error) {
 	}
 	type ext struct {
 		base
-		Default interface{} `json:"default"`
+		Default any `json:"default"`
 	}
 
 	b := base{
@@ -665,7 +665,7 @@ func (f *Field) MarshalJSON() ([]byte, error) {
 		b.Order = string(f.order)
 	}
 
-	var s interface{} = b
+	var s any = b
 	if f.hasDef {
 		s = ext{
 			base:    s.(base),
@@ -1256,7 +1256,7 @@ func validateName(name string) error {
 	return nil
 }
 
-func validateDefault(name string, schema Schema, def interface{}) (interface{}, error) {
+func validateDefault(name string, schema Schema, def any) (any, error) {
 	def, ok := isValidDefault(schema, def)
 	if !ok {
 		return nil, fmt.Errorf("avro: invalid default for field %s. %+v not a %s", name, def, schema.Type())
@@ -1265,7 +1265,7 @@ func validateDefault(name string, schema Schema, def interface{}) (interface{},
 	return def, nil
 }
 
-func isValidDefault(schema Schema, def interface{}) (interface{}, bool) {
+func isValidDefault(schema Schema, def any) (any, bool) {
 	switch schema.Type() {
 	case Null:
 		return nullDefault, def == nil
@@ -1319,7 +1319,7 @@ func isValidDefault(schema Schema, def interface{}) (interface{}, bool) {
 		}
 
 	case Array:
-		arr, ok := def.([]interface{})
+		arr, ok := def.([]any)
 		if !ok {
 			return nil, false
 		}
@@ -1336,7 +1336,7 @@ func isValidDefault(schema Schema, def interface{}) (interface{}, bool) {
 		return arr, true
 
 	case Map:
-		m, ok := def.(map[string]interface{})
+		m, ok := def.(map[string]any)
 		if !ok {
 			return nil, false
 		}
@@ -1358,7 +1358,7 @@ func isValidDefault(schema Schema, def interface{}) (interface{}, bool) {
 		return isValidDefault(unionSchema.Types()[0], def)
 
 	case Record:
-		m, ok := def.(map[string]interface{})
+		m, ok := def.(map[string]any)
 		if !ok {
 			return nil, false
 		}
diff --git a/schema_parse.go b/schema_parse.go
index 2d74e93..6e5b698 100644
--- a/schema_parse.go
+++ b/schema_parse.go
@@ -22,7 +22,7 @@ func Parse(schema string) (Schema, error) {
 
 // ParseWithCache parses a schema string using the given namespace and  schema cache.
 func ParseWithCache(schema, namespace string, cache *SchemaCache) (Schema, error) {
-	var json interface{}
+	var json any
 	if err := jsoniter.Unmarshal([]byte(schema), &json); err != nil {
 		json = schema
 	}
@@ -60,7 +60,7 @@ func ParseFiles(paths ...string) (Schema, error) {
 	return schema, nil
 }
 
-func parseType(namespace string, v interface{}, cache *SchemaCache) (Schema, error) {
+func parseType(namespace string, v any, cache *SchemaCache) (Schema, error) {
 	switch val := v.(type) {
 	case nil:
 		return &NullSchema{}, nil
@@ -68,10 +68,10 @@ func parseType(namespace string, v interface{}, cache *SchemaCache) (Schema, err
 	case string:
 		return parsePrimitiveType(namespace, val, cache)
 
-	case map[string]interface{}:
+	case map[string]any:
 		return parseComplexType(namespace, val, cache)
 
-	case []interface{}:
+	case []any:
 		return parseUnion(namespace, val, cache)
 	}
 
@@ -97,8 +97,8 @@ func parsePrimitiveType(namespace, s string, cache *SchemaCache) (Schema, error)
 	}
 }
 
-func parseComplexType(namespace string, m map[string]interface{}, cache *SchemaCache) (Schema, error) {
-	if val, ok := m["type"].([]interface{}); ok {
+func parseComplexType(namespace string, m map[string]any, cache *SchemaCache) (Schema, error) {
+	if val, ok := m["type"].([]any); ok {
 		return parseUnion(namespace, val, cache)
 	}
 
@@ -136,13 +136,13 @@ func parseComplexType(namespace string, m map[string]interface{}, cache *SchemaC
 }
 
 type primitiveSchema struct {
-	LogicalType string                 `mapstructure:"logicalType"`
-	Precision   int                    `mapstructure:"precision"`
-	Scale       int                    `mapstructure:"scale"`
-	Props       map[string]interface{} `mapstructure:",remain"`
+	LogicalType string         `mapstructure:"logicalType"`
+	Precision   int            `mapstructure:"precision"`
+	Scale       int            `mapstructure:"scale"`
+	Props       map[string]any `mapstructure:",remain"`
 }
 
-func parsePrimitive(typ Type, m map[string]interface{}) (Schema, error) {
+func parsePrimitive(typ Type, m map[string]any) (Schema, error) {
 	if m == nil {
 		return NewPrimitiveSchema(typ, nil), nil
 	}
@@ -182,16 +182,16 @@ func parsePrimitiveLogicalType(typ Type, lt string, prec, scale int) LogicalSche
 }
 
 type recordSchema struct {
-	Type      string                   `mapstructure:"type"`
-	Name      string                   `mapstructure:"name"`
-	Namespace string                   `mapstructure:"namespace"`
-	Aliases   []string                 `mapstructure:"aliases"`
-	Doc       string                   `mapstructure:"doc"`
-	Fields    []map[string]interface{} `mapstructure:"fields"`
-	Props     map[string]interface{}   `mapstructure:",remain"`
+	Type      string           `mapstructure:"type"`
+	Name      string           `mapstructure:"name"`
+	Namespace string           `mapstructure:"namespace"`
+	Aliases   []string         `mapstructure:"aliases"`
+	Doc       string           `mapstructure:"doc"`
+	Fields    []map[string]any `mapstructure:"fields"`
+	Props     map[string]any   `mapstructure:",remain"`
 }
 
-func parseRecord(typ Type, namespace string, m map[string]interface{}, cache *SchemaCache) (Schema, error) {
+func parseRecord(typ Type, namespace string, m map[string]any, cache *SchemaCache) (Schema, error) {
 	var (
 		r    recordSchema
 		meta mapstructure.Metadata
@@ -248,16 +248,16 @@ func parseRecord(typ Type, namespace string, m map[string]interface{}, cache *Sc
 }
 
 type fieldSchema struct {
-	Name    string                 `mapstructure:"name"`
-	Aliases []string               `mapstructure:"aliases"`
-	Type    interface{}            `mapstructure:"type"`
-	Doc     string                 `mapstructure:"doc"`
-	Default interface{}            `mapstructure:"default"`
-	Order   Order                  `mapstructure:"order"`
-	Props   map[string]interface{} `mapstructure:",remain"`
+	Name    string         `mapstructure:"name"`
+	Aliases []string       `mapstructure:"aliases"`
+	Type    any            `mapstructure:"type"`
+	Doc     string         `mapstructure:"doc"`
+	Default any            `mapstructure:"default"`
+	Order   Order          `mapstructure:"order"`
+	Props   map[string]any `mapstructure:",remain"`
 }
 
-func parseField(namespace string, m map[string]interface{}, cache *SchemaCache) (*Field, error) {
+func parseField(namespace string, m map[string]any, cache *SchemaCache) (*Field, error) {
 	var (
 		f    fieldSchema
 		meta mapstructure.Metadata
@@ -293,17 +293,17 @@ func parseField(namespace string, m map[string]interface{}, cache *SchemaCache)
 }
 
 type enumSchema struct {
-	Name      string                 `mapstructure:"name"`
-	Namespace string                 `mapstructure:"namespace"`
-	Aliases   []string               `mapstructure:"aliases"`
-	Type      string                 `mapstructure:"type"`
-	Doc       string                 `mapstructure:"doc"`
-	Symbols   []string               `mapstructure:"symbols"`
-	Default   string                 `mapstructure:"default"`
-	Props     map[string]interface{} `mapstructure:",remain"`
+	Name      string         `mapstructure:"name"`
+	Namespace string         `mapstructure:"namespace"`
+	Aliases   []string       `mapstructure:"aliases"`
+	Type      string         `mapstructure:"type"`
+	Doc       string         `mapstructure:"doc"`
+	Symbols   []string       `mapstructure:"symbols"`
+	Default   string         `mapstructure:"default"`
+	Props     map[string]any `mapstructure:",remain"`
 }
 
-func parseEnum(namespace string, m map[string]interface{}, cache *SchemaCache) (Schema, error) {
+func parseEnum(namespace string, m map[string]any, cache *SchemaCache) (Schema, error) {
 	var (
 		e    enumSchema
 		meta mapstructure.Metadata
@@ -335,11 +335,11 @@ func parseEnum(namespace string, m map[string]interface{}, cache *SchemaCache) (
 }
 
 type arraySchema struct {
-	Items interface{}            `mapstructure:"items"`
-	Props map[string]interface{} `mapstructure:",remain"`
+	Items any            `mapstructure:"items"`
+	Props map[string]any `mapstructure:",remain"`
 }
 
-func parseArray(namespace string, m map[string]interface{}, cache *SchemaCache) (Schema, error) {
+func parseArray(namespace string, m map[string]any, cache *SchemaCache) (Schema, error) {
 	var (
 		a    arraySchema
 		meta mapstructure.Metadata
@@ -360,11 +360,11 @@ func parseArray(namespace string, m map[string]interface{}, cache *SchemaCache)
 }
 
 type mapSchema struct {
-	Values interface{}            `mapstructure:"values"`
-	Props  map[string]interface{} `mapstructure:",remain"`
+	Values any            `mapstructure:"values"`
+	Props  map[string]any `mapstructure:",remain"`
 }
 
-func parseMap(namespace string, m map[string]interface{}, cache *SchemaCache) (Schema, error) {
+func parseMap(namespace string, m map[string]any, cache *SchemaCache) (Schema, error) {
 	var (
 		ms   mapSchema
 		meta mapstructure.Metadata
@@ -384,7 +384,7 @@ func parseMap(namespace string, m map[string]interface{}, cache *SchemaCache) (S
 	return NewMapSchema(schema, WithProps(ms.Props)), nil
 }
 
-func parseUnion(namespace string, v []interface{}, cache *SchemaCache) (Schema, error) {
+func parseUnion(namespace string, v []any, cache *SchemaCache) (Schema, error) {
 	var err error
 	types := make([]Schema, len(v))
 	for i := range v {
@@ -398,18 +398,18 @@ func parseUnion(namespace string, v []interface{}, cache *SchemaCache) (Schema,
 }
 
 type fixedSchema struct {
-	Name        string                 `mapstructure:"name"`
-	Namespace   string                 `mapstructure:"namespace"`
-	Aliases     []string               `mapstructure:"aliases"`
-	Type        string                 `mapstructure:"type"`
-	Size        int                    `mapstructure:"size"`
-	LogicalType string                 `mapstructure:"logicalType"`
-	Precision   int                    `mapstructure:"precision"`
-	Scale       int                    `mapstructure:"scale"`
-	Props       map[string]interface{} `mapstructure:",remain"`
+	Name        string         `mapstructure:"name"`
+	Namespace   string         `mapstructure:"namespace"`
+	Aliases     []string       `mapstructure:"aliases"`
+	Type        string         `mapstructure:"type"`
+	Size        int            `mapstructure:"size"`
+	LogicalType string         `mapstructure:"logicalType"`
+	Precision   int            `mapstructure:"precision"`
+	Scale       int            `mapstructure:"scale"`
+	Props       map[string]any `mapstructure:",remain"`
 }
 
-func parseFixed(namespace string, m map[string]interface{}, cache *SchemaCache) (Schema, error) {
+func parseFixed(namespace string, m map[string]any, cache *SchemaCache) (Schema, error) {
 	var (
 		f    fixedSchema
 		meta mapstructure.Metadata
@@ -510,7 +510,7 @@ func hasKey(keys []string, k string) bool {
 	return false
 }
 
-func decodeMap(in, v interface{}, meta *mapstructure.Metadata) error {
+func decodeMap(in, v any, meta *mapstructure.Metadata) error {
 	cfg := &mapstructure.DecoderConfig{
 		ZeroFields: true,
 		Metadata:   meta,


Test patch:
diff --git a/bench_test.go b/bench_test.go
index 9d89c21..9cf6b08 100644
--- a/bench_test.go
+++ b/bench_test.go
@@ -112,7 +112,7 @@ func BenchmarkSuperheroGenericDecode(b *testing.B) {
 	b.ReportAllocs()
 	b.ResetTimer()
 	for i := 0; i < b.N; i++ {
-		var m interface{}
+		var m any
 		_ = avro.Unmarshal(schema, data, &m)
 	}
 }
@@ -123,13 +123,13 @@ func BenchmarkSuperheroGenericEncode(b *testing.B) {
 		panic(err)
 	}
 
-	super := map[string]interface{}{
+	super := map[string]any{
 		"id":             234765,
 		"affiliation_id": 9867,
 		"Name":           "Wolverine",
 		"life":           85.25,
 		"energy":         32.75,
-		"powers": []map[string]interface{}{
+		"powers": []map[string]any{
 			{"id": 2345, "name": "Bone Claws", "damage": 5, "energy": 1.15, "passive": false},
 			{"id": 2346, "name": "Regeneration", "damage": -2, "energy": 0.55, "passive": true},
 			{"id": 2347, "name": "Adamant skeleton", "damage": -10, "energy": 0, "passive": true},
diff --git a/decoder_dynamic_test.go b/decoder_dynamic_test.go
index 7671b66..5b5684f 100644
--- a/decoder_dynamic_test.go
+++ b/decoder_dynamic_test.go
@@ -14,22 +14,22 @@ func TestDecoder_Interface(t *testing.T) {
 		name   string
 		data   []byte
 		schema string
-		got    interface{}
-		want   interface{}
+		got    any
+		want   any
 	}{
 		{
 			name:   "Empty Interface",
 			data:   []byte{0x36, 0x06, 0x66, 0x6f, 0x6f},
 			schema: `{"type": "record", "name": "test", "fields" : [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}`,
 			got:    nil,
-			want:   map[string]interface{}{"a": int64(27), "b": "foo"},
+			want:   map[string]any{"a": int64(27), "b": "foo"},
 		},
 		{
 			name:   "Interface Non-Ptr",
 			data:   []byte{0x36, 0x06, 0x66, 0x6f, 0x6f},
 			schema: `{"type": "record", "name": "test", "fields": [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}`,
 			got:    TestRecord{},
-			want:   map[string]interface{}{"a": int64(27), "b": "foo"},
+			want:   map[string]any{"a": int64(27), "b": "foo"},
 		},
 		{
 			name:   "Interface Nil Ptr",
diff --git a/decoder_record_test.go b/decoder_record_test.go
index dad94ad..9ed1cca 100644
--- a/decoder_record_test.go
+++ b/decoder_record_test.go
@@ -199,11 +199,11 @@ func TestDecoder_RecordMap(t *testing.T) {
 	dec, err := avro.NewDecoder(schema, bytes.NewReader(data))
 	require.NoError(t, err)
 
-	var got map[string]interface{}
+	var got map[string]any
 	err = dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.Equal(t, map[string]interface{}{"a": int64(27), "b": "foo"}, got)
+	assert.Equal(t, map[string]any{"a": int64(27), "b": "foo"}, got)
 }
 
 func TestDecoder_RecordMapInvalidKey(t *testing.T) {
@@ -221,7 +221,7 @@ func TestDecoder_RecordMapInvalidKey(t *testing.T) {
 	dec, err := avro.NewDecoder(schema, bytes.NewReader(data))
 	require.NoError(t, err)
 
-	var got map[int]interface{}
+	var got map[int]any
 	err = dec.Decode(&got)
 
 	assert.Error(t, err)
@@ -263,7 +263,7 @@ func TestDecoder_RecordMapInvalidData(t *testing.T) {
 	dec, err := avro.NewDecoder(schema, bytes.NewReader(data))
 	require.NoError(t, err)
 
-	var got map[string]interface{}
+	var got map[string]any
 	err = dec.Decode(&got)
 
 	assert.Error(t, err)
diff --git a/decoder_union_test.go b/decoder_union_test.go
index 3000bf1..bbc1fe6 100644
--- a/decoder_union_test.go
+++ b/decoder_union_test.go
@@ -32,11 +32,11 @@ func TestDecoder_UnionMap(t *testing.T) {
 	schema := `["null", "string"]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.Equal(t, map[string]interface{}{"string": "foo"}, got)
+	assert.Equal(t, map[string]any{"string": "foo"}, got)
 }
 
 func TestDecoder_UnionMapNamed(t *testing.T) {
@@ -46,11 +46,11 @@ func TestDecoder_UnionMapNamed(t *testing.T) {
 	schema := `["null", {"type":"enum", "name": "test", "symbols": ["foo", "bar"]}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.Equal(t, map[string]interface{}{"test": "bar"}, got)
+	assert.Equal(t, map[string]any{"test": "bar"}, got)
 }
 
 func TestDecoder_UnionMapNull(t *testing.T) {
@@ -60,11 +60,11 @@ func TestDecoder_UnionMapNull(t *testing.T) {
 	schema := `["null", "string"]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.Equal(t, map[string]interface{}(nil), got)
+	assert.Equal(t, map[string]any(nil), got)
 }
 
 func TestDecoder_UnionMapWithTime(t *testing.T) {
@@ -74,7 +74,7 @@ func TestDecoder_UnionMapWithTime(t *testing.T) {
 	schema := `["null", {"type": "long", "logicalType": "timestamp-micros"}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -88,7 +88,7 @@ func TestDecoder_UnionMapWithDuration(t *testing.T) {
 	schema := `["null", {"type": "int", "logicalType": "time-millis"}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -103,7 +103,7 @@ func TestDecoder_UnionMapWithDecimal(t *testing.T) {
 		schema := `["null", {"type": "bytes", "logicalType": "decimal", "precision": 4, "scale": 2}]`
 		dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-		var got map[string]interface{}
+		var got map[string]any
 		err := dec.Decode(&got)
 
 		require.NoError(t, err)
@@ -115,7 +115,7 @@ func TestDecoder_UnionMapWithDecimal(t *testing.T) {
 		schema := `["null", {"type": "bytes", "logicalType": "decimal", "precision": 77, "scale": 38}]`
 		dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-		var got map[string]interface{}
+		var got map[string]any
 		err := dec.Decode(&got)
 
 		require.NoError(t, err)
@@ -130,7 +130,7 @@ func TestDecoder_UnionMapInvalidSchema(t *testing.T) {
 	schema := `["null", "string"]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	assert.Error(t, err)
@@ -258,7 +258,7 @@ func TestDecoder_UnionInterface(t *testing.T) {
 	schema := `["null", "int"]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -294,11 +294,11 @@ func TestDecoder_UnionInterfaceInMap(t *testing.T) {
 	schema := `{"type": "map", "values": ["int", "string"]}`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.Equal(t, map[string]interface{}{"foo": 27}, got)
+	assert.Equal(t, map[string]any{"foo": 27}, got)
 }
 
 func TestDecoder_UnionInterfaceInMapWithBool(t *testing.T) {
@@ -308,11 +308,11 @@ func TestDecoder_UnionInterfaceInMapWithBool(t *testing.T) {
 	schema := `{"type":"map", "values": ["null", "boolean"]}`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got map[string]interface{}
+	var got map[string]any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.Equal(t, map[string]interface{}{"foo": true}, got)
+	assert.Equal(t, map[string]any{"foo": true}, got)
 }
 
 func TestDecoder_UnionInterfaceMap(t *testing.T) {
@@ -324,7 +324,7 @@ func TestDecoder_UnionInterfaceMap(t *testing.T) {
 	schema := `["int", {"type": "map", "values": "int"}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -340,7 +340,7 @@ func TestDecoder_UnionInterfaceMapNamed(t *testing.T) {
 	schema := `["int", {"type": "map", "values": {"type":"enum", "name": "test", "symbols": ["A", "B"]}}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -356,7 +356,7 @@ func TestDecoder_UnionInterfaceArray(t *testing.T) {
 	schema := `["int", {"type": "array", "items": "int"}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -372,7 +372,7 @@ func TestDecoder_UnionInterfaceArrayNamed(t *testing.T) {
 	schema := `["int", {"type": "array", "items": {"type":"enum", "name": "test", "symbols": ["A", "B"]}}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -386,7 +386,7 @@ func TestDecoder_UnionInterfaceNull(t *testing.T) {
 	schema := `["null", "string"]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -402,7 +402,7 @@ func TestDecoder_UnionInterfaceNamed(t *testing.T) {
 	schema := `["null", {"type":"enum", "name": "test", "symbols": ["A", "B"]}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -418,7 +418,7 @@ func TestDecoder_UnionInterfaceRecord(t *testing.T) {
 	schema := `["int", {"type": "record", "name": "test", "fields" : [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -437,7 +437,7 @@ func TestDecoder_UnionInterfaceRecordNotReused(t *testing.T) {
 	schema := `["int", {"type": "record", "name": "test", "fields" : [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{} = ""
+	var got any = ""
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -454,15 +454,15 @@ func TestDecoder_UnionInterfaceUnresolvableType(t *testing.T) {
 	schema := `["int", {"type": "record", "name": "test", "fields" : [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.IsType(t, map[string]interface{}{}, got)
-	m := got.(map[string]interface{})
-	assert.IsType(t, map[string]interface{}{}, m["test"])
-	assert.Equal(t, int64(27), m["test"].(map[string]interface{})["a"])
-	assert.Equal(t, "foo", m["test"].(map[string]interface{})["b"])
+	assert.IsType(t, map[string]any{}, got)
+	m := got.(map[string]any)
+	assert.IsType(t, map[string]any{}, m["test"])
+	assert.Equal(t, int64(27), m["test"].(map[string]any)["a"])
+	assert.Equal(t, "foo", m["test"].(map[string]any)["b"])
 }
 
 func TestDecoder_UnionInterfaceDualRecords(t *testing.T) {
@@ -479,7 +479,7 @@ func TestDecoder_UnionInterfaceDualRecords(t *testing.T) {
 	]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -502,15 +502,15 @@ func TestDecoder_UnionInterfaceDualRecordsUnresolvableType(t *testing.T) {
 	]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
-	assert.IsType(t, map[string]interface{}{}, got)
-	m := got.(map[string]interface{})
-	assert.IsType(t, map[string]interface{}{}, m["test"])
-	assert.Equal(t, int64(27), m["test"].(map[string]interface{})["a"])
-	assert.Equal(t, "foo", m["test"].(map[string]interface{})["b"])
+	assert.IsType(t, map[string]any{}, got)
+	m := got.(map[string]any)
+	assert.IsType(t, map[string]any{}, m["test"])
+	assert.Equal(t, int64(27), m["test"].(map[string]any)["a"])
+	assert.Equal(t, "foo", m["test"].(map[string]any)["b"])
 }
 
 func TestDecoder_UnionInterfaceDualRecordsPartialResolution(t *testing.T) {
@@ -528,7 +528,7 @@ func TestDecoder_UnionInterfaceDualRecordsPartialResolution(t *testing.T) {
 	]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -545,7 +545,7 @@ func TestDecoder_UnionInterfaceWithTime(t *testing.T) {
 	schema := `["null", {"type": "long", "logicalType": "timestamp-micros"}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -559,7 +559,7 @@ func TestDecoder_UnionInterfaceWithDuration(t *testing.T) {
 	schema := `["null", {"type": "int", "logicalType": "time-millis"}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	require.NoError(t, err)
@@ -574,7 +574,7 @@ func TestDecoder_UnionInterfaceWithDecimal(t *testing.T) {
 		schema := `["null", {"type": "bytes", "logicalType": "decimal", "precision": 4, "scale": 2}]`
 		dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-		var got interface{}
+		var got any
 		err := dec.Decode(&got)
 
 		require.NoError(t, err)
@@ -586,7 +586,7 @@ func TestDecoder_UnionInterfaceWithDecimal(t *testing.T) {
 		schema := `["null", {"type": "bytes", "logicalType": "decimal", "precision": 77, "scale": 38}]`
 		dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-		var got interface{}
+		var got any
 		err := dec.Decode(&got)
 
 		require.NoError(t, err)
@@ -602,7 +602,7 @@ func TestDecoder_UnionInterfaceWithDecimal_Negative(t *testing.T) {
 		schema := `["null", {"type": "bytes", "logicalType": "decimal", "precision": 4, "scale": 2}]`
 		dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-		var got interface{}
+		var got any
 		err := dec.Decode(&got)
 
 		require.NoError(t, err)
@@ -613,7 +613,7 @@ func TestDecoder_UnionInterfaceWithDecimal_Negative(t *testing.T) {
 		schema := `["null", {"type": "bytes", "logicalType": "decimal", "precision": 77, "scale": 38}]`
 		dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-		var got interface{}
+		var got any
 		err := dec.Decode(&got)
 
 		require.NoError(t, err)
@@ -630,7 +630,7 @@ func TestDecoder_UnionInterfaceUnresolvableTypeWithError(t *testing.T) {
 	schema := `["int", {"type": "record", "name": "test", "fields" : [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	assert.EqualError(t, err, "avro: problem resolving decoder for Avro union: avro: unable to resolve type with name test")
@@ -643,7 +643,7 @@ func TestDecoder_UnionInterfaceInvalidSchema(t *testing.T) {
 	schema := `["null", "int"]`
 	dec, _ := avro.NewDecoder(schema, bytes.NewReader(data))
 
-	var got interface{}
+	var got any
 	err := dec.Decode(&got)
 
 	assert.Error(t, err)
diff --git a/encoder_record_test.go b/encoder_record_test.go
index 95d2080..149d92f 100644
--- a/encoder_record_test.go
+++ b/encoder_record_test.go
@@ -300,7 +300,7 @@ func TestEncoder_RecordMap(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"a": int64(27), "b": "foo"}
+	obj := map[string]any{"a": int64(27), "b": "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -329,7 +329,7 @@ func TestEncoder_RecordMapNested(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"a": map[string]interface{}{
+	obj := map[string]any{"a": map[string]any{
 		"a": int64(27),
 		"b": "bar",
 	}, "b": "foo"}
@@ -354,7 +354,7 @@ func TestEncoder_RecordMapNilValue(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"a": int64(27), "b": nil}
+	obj := map[string]any{"a": int64(27), "b": nil}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -375,7 +375,7 @@ func TestEncoder_RecordMapMissingRequiredField(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"b": "foo"}
+	obj := map[string]any{"b": "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -396,7 +396,7 @@ func TestEncoder_RecordMapWithDefault(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"b": "foo"}
+	obj := map[string]any{"b": "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -418,7 +418,7 @@ func TestEncoder_RecordMapWithNullDefault(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"b": "foo"}
+	obj := map[string]any{"b": "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -440,7 +440,7 @@ func TestEncoder_RecordMapWithUnionNullDefault(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"b": "foo"}
+	obj := map[string]any{"b": "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -462,7 +462,7 @@ func TestEncoder_RecordMapWithUnionStringDefault(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[string]interface{}{"b": "foo"}
+	obj := map[string]any{"b": "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
@@ -484,7 +484,7 @@ func TestEncoder_RecordMapInvalidKeyType(t *testing.T) {
 	    {"name": "b", "type": "string"}
 	]
 }`
-	obj := map[int]interface{}{1: int64(27), 2: "foo"}
+	obj := map[int]any{1: int64(27), 2: "foo"}
 	buf := &bytes.Buffer{}
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
diff --git a/encoder_union_test.go b/encoder_union_test.go
index eccfd5c..215da87 100644
--- a/encoder_union_test.go
+++ b/encoder_union_test.go
@@ -19,7 +19,7 @@ func TestEncoder_UnionMap(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	err = enc.Encode(map[string]interface{}{"string": "foo"})
+	err = enc.Encode(map[string]any{"string": "foo"})
 
 	require.NoError(t, err)
 	assert.Equal(t, []byte{0x02, 0x06, 0x66, 0x6F, 0x6F}, buf.Bytes())
@@ -40,7 +40,7 @@ func TestEncoder_UnionMapRecord(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	err = enc.Encode(map[string]interface{}{"test": map[string]interface{}{"b": "foo"}})
+	err = enc.Encode(map[string]any{"test": map[string]any{"b": "foo"}})
 
 	require.NoError(t, err)
 	assert.Equal(t, []byte{0x02, 0x00, 0x08, 0x74, 0x65, 0x73, 0x74, 0x06, 0x66, 0x6F, 0x6F}, buf.Bytes())
@@ -54,7 +54,7 @@ func TestEncoder_UnionMapNamed(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	err = enc.Encode(map[string]interface{}{"test": "bar"})
+	err = enc.Encode(map[string]any{"test": "bar"})
 
 	require.NoError(t, err)
 	assert.Equal(t, []byte{0x02, 0x02}, buf.Bytes())
@@ -68,7 +68,7 @@ func TestEncoder_UnionMapNull(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var m map[string]interface{}
+	var m map[string]any
 	err = enc.Encode(m)
 
 	require.NoError(t, err)
@@ -83,7 +83,7 @@ func TestEncoder_UnionMapMultipleEntries(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	err = enc.Encode(map[string]interface{}{"string": "foo", "int": 27})
+	err = enc.Encode(map[string]any{"string": "foo", "int": 27})
 
 	assert.Error(t, err)
 }
@@ -96,7 +96,7 @@ func TestEncoder_UnionMapWithTime(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	m := map[string]interface{}{
+	m := map[string]any{
 		"long.timestamp-micros": time.Date(2020, 1, 2, 3, 4, 5, 0, time.UTC),
 	}
 	err = enc.Encode(m)
@@ -113,7 +113,7 @@ func TestEncoder_UnionMapWithDuration(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	m := map[string]interface{}{
+	m := map[string]any{
 		"int.time-millis": 123456789 * time.Millisecond,
 	}
 	err = enc.Encode(m)
@@ -131,7 +131,7 @@ func TestEncoder_UnionMapWithDecimal(t *testing.T) {
 		enc, err := avro.NewEncoder(schema, buf)
 		require.NoError(t, err)
 
-		m := map[string]interface{}{
+		m := map[string]any{
 			"bytes.decimal": big.NewRat(1734, 5),
 		}
 		err = enc.Encode(m)
@@ -146,7 +146,7 @@ func TestEncoder_UnionMapWithDecimal(t *testing.T) {
 		enc, err := avro.NewEncoder(schema, buf)
 		require.NoError(t, err)
 
-		m := map[string]interface{}{
+		m := map[string]any{
 			"bytes.decimal": big.NewRat(1734, 5),
 		}
 		err = enc.Encode(m)
@@ -164,7 +164,7 @@ func TestEncoder_UnionMapInvalidType(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	err = enc.Encode(map[string]interface{}{"long": 27})
+	err = enc.Encode(map[string]any{"long": 27})
 
 	assert.Error(t, err)
 }
@@ -264,7 +264,7 @@ func TestEncoder_UnionInterface(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = "foo"
+	var val any = "foo"
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -281,7 +281,7 @@ func TestEncoder_UnionInterfaceRecord(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = &TestRecord{A: 27, B: "foo"}
+	var val any = &TestRecord{A: 27, B: "foo"}
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -298,7 +298,7 @@ func TestEncoder_UnionInterfaceRecordNonPtr(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = TestRecord{A: 27, B: "foo"}
+	var val any = TestRecord{A: 27, B: "foo"}
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -315,7 +315,7 @@ func TestEncoder_UnionInterfaceMap(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = map[string]int{"foo": 27}
+	var val any = map[string]int{"foo": 27}
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -330,7 +330,7 @@ func TestEncoder_UnionInterfaceInMapWithBool(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	err = enc.Encode(map[string]interface{}{"foo": true})
+	err = enc.Encode(map[string]any{"foo": true})
 
 	require.NoError(t, err)
 	assert.Equal(t, []byte{0x01, 0x0c, 0x06, 0x66, 0x6F, 0x6F, 0x02, 0x01, 0x00}, buf.Bytes())
@@ -346,7 +346,7 @@ func TestEncoder_UnionInterfaceArray(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = []int{27}
+	var val any = []int{27}
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -377,7 +377,7 @@ func TestEncoder_UnionInterfaceNamed(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = "B"
+	var val any = "B"
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -392,7 +392,7 @@ func TestEncoder_UnionInterfaceWithTime(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = time.Date(2020, 1, 2, 3, 4, 5, 0, time.UTC)
+	var val any = time.Date(2020, 1, 2, 3, 4, 5, 0, time.UTC)
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -407,7 +407,7 @@ func TestEncoder_UnionInterfaceWithDuration(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = 123456789 * time.Millisecond
+	var val any = 123456789 * time.Millisecond
 	err = enc.Encode(val)
 
 	require.NoError(t, err)
@@ -423,7 +423,7 @@ func TestEncoder_UnionInterfaceWithDecimal(t *testing.T) {
 		enc, err := avro.NewEncoder(schema, buf)
 		require.NoError(t, err)
 
-		var val interface{} = big.NewRat(1734, 5)
+		var val any = big.NewRat(1734, 5)
 		err = enc.Encode(val)
 
 		require.NoError(t, err)
@@ -436,7 +436,7 @@ func TestEncoder_UnionInterfaceWithDecimal(t *testing.T) {
 		enc, err := avro.NewEncoder(schema, buf)
 		require.NoError(t, err)
 
-		var val interface{} = big.NewRat(1734, 5)
+		var val any = big.NewRat(1734, 5)
 		err = enc.Encode(val)
 
 		require.NoError(t, err)
@@ -452,7 +452,7 @@ func TestEncoder_UnionInterfaceUnregisteredType(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = &TestRecord{}
+	var val any = &TestRecord{}
 	err = enc.Encode(val)
 
 	assert.Error(t, err)
@@ -468,7 +468,7 @@ func TestEncoder_UnionInterfaceNotInSchema(t *testing.T) {
 	enc, err := avro.NewEncoder(schema, buf)
 	require.NoError(t, err)
 
-	var val interface{} = &TestRecord{}
+	var val any = &TestRecord{}
 	err = enc.Encode(val)
 
 	assert.Error(t, err)
diff --git a/example_resolver_test.go b/example_resolver_test.go
index 9b98498..311a0d3 100644
--- a/example_resolver_test.go
+++ b/example_resolver_test.go
@@ -13,7 +13,7 @@ func ExampleRegister() {
 
 	avro.Register("test", "") // Register the name test as a string type
 
-	var result interface{}
+	var result any
 	err := avro.Unmarshal(schema, data, &result)
 	if err != nil {
 		log.Fatal(err)
diff --git a/gen/testdata/golden.go b/gen/testdata/golden.go
index cdd3d05..5997dfe 100644
--- a/gen/testdata/golden.go
+++ b/gen/testdata/golden.go
@@ -65,7 +65,7 @@ type Test struct {
 	ABytesDecimal                   *big.Rat               `avro:"aBytesDecimal"`
 	ARecordArray                    []RecordInArray        `avro:"aRecordArray"`
 	NullableRecordUnion             *RecordInNullableUnion `avro:"nullableRecordUnion"`
-	NonNullableRecordUnion          interface{}            `avro:"nonNullableRecordUnion"`
-	NullableRecordUnionWith3Options interface{}            `avro:"nullableRecordUnionWith3Options"`
+	NonNullableRecordUnion          any                    `avro:"nonNullableRecordUnion"`
+	NullableRecordUnionWith3Options any                    `avro:"nullableRecordUnionWith3Options"`
 	Ref                             Record2InNullableUnion `avro:"ref"`
 }
diff --git a/reader_generic_test.go b/reader_generic_test.go
index b58cb22..f1157d7 100644
--- a/reader_generic_test.go
+++ b/reader_generic_test.go
@@ -16,7 +16,7 @@ func TestReader_ReadNext(t *testing.T) {
 		name    string
 		data    []byte
 		schema  string
-		want    interface{}
+		want    any
 		wantErr require.ErrorAssertionFunc
 	}{
 
@@ -115,28 +115,28 @@ func TestReader_ReadNext(t *testing.T) {
 			name:    "Record",
 			data:    []byte{0x36, 0x06, 0x66, 0x6f, 0x6f},
 			schema:  `{"type": "record", "name": "test", "fields" : [{"name": "a", "type": "long"}, {"name": "b", "type": "string"}]}`,
-			want:    map[string]interface{}{"a": int64(27), "b": "foo"},
+			want:    map[string]any{"a": int64(27), "b": "foo"},
 			wantErr: require.NoError,
 		},
 		{
 			name:    "Ref",
 			data:    []byte{0x36, 0x06, 0x66, 0x6f, 0x6f, 0x36, 0x06, 0x66, 0x6f, 0x6f},
 			schema:  `{"type":"record","name":"parent","fields":[{"name":"a","type":{"type":"record","name":"test","fields":[{"name":"a","type":"long"},{"name":"b","type":"string"}]}},{"name":"b","type":"test"}]}`,
-			want:    map[string]interface{}{"a": map[string]interface{}{"a": int64(27), "b": "foo"}, "b": map[string]interface{}{"a": int64(27), "b": "foo"}},
+			want:    map[string]any{"a": map[string]any{"a": int64(27), "b": "foo"}, "b": map[string]any{"a": int64(27), "b": "foo"}},
 			wantErr: require.NoError,
 		},
 		{
 			name:    "Array",
 			data:    []byte{0x04, 0x36, 0x38, 0x0},
 			schema:  `{"type":"array", "items": "int"}`,
-			want:    []interface{}{27, 28},
+			want:    []any{27, 28},
 			wantErr: require.NoError,
 		},
 		{
 			name:    "Map",
 			data:    []byte{0x02, 0x06, 0x66, 0x6F, 0x6F, 0x06, 0x66, 0x6F, 0x6F, 0x00},
 			schema:  `{"type":"map", "values": "string"}`,
-			want:    map[string]interface{}{"foo": "foo"},
+			want:    map[string]any{"foo": "foo"},
 			wantErr: require.NoError,
 		},
 		{
@@ -157,7 +157,7 @@ func TestReader_ReadNext(t *testing.T) {
 			name:    "Union",
 			data:    []byte{0x02, 0x06, 0x66, 0x6F, 0x6F},
 			schema:  `["null", "string"]`,
-			want:    map[string]interface{}{"string": "foo"},
+			want:    map[string]any{"string": "foo"},
 			wantErr: require.NoError,
 		},
 		{
@@ -171,7 +171,7 @@ func TestReader_ReadNext(t *testing.T) {
 			name:    "Union Named",
 			data:    []byte{0x02, 0x02},
 			schema:  `["null", {"type":"enum", "name": "test", "symbols": ["foo", "bar"]}]`,
-			want:    map[string]interface{}{"test": "bar"},
+			want:    map[string]any{"test": "bar"},
 			wantErr: require.NoError,
 		},
 		{
diff --git a/registry/client_test.go b/registry/client_test.go
index 0133f0a..ab4f186 100644
--- a/registry/client_test.go
+++ b/registry/client_test.go
@@ -502,15 +502,15 @@ func TestClient_IsRegisteredWithRefs(t *testing.T) {
 
 		body, err := io.ReadAll(r.Body)
 		require.NoError(t, err)
-		var decoded map[string]interface{}
+		var decoded map[string]any
 		err = json.Unmarshal(body, &decoded)
 		require.NoError(t, err)
 
 		assert.Contains(t, decoded, "references")
-		refs, ok := decoded["references"].([]interface{})
+		refs, ok := decoded["references"].([]any)
 		require.True(t, true)
 		require.Len(t, refs, 1)
-		ref, ok := refs[0].(map[string]interface{})
+		ref, ok := refs[0].(map[string]any)
 		require.True(t, ok)
 
 		assert.Equal(t, "some_schema", ref["name"].(string))
diff --git a/schema_internal_test.go b/schema_internal_test.go
index 6ec0295..39773ed 100644
--- a/schema_internal_test.go
+++ b/schema_internal_test.go
@@ -99,8 +99,8 @@ func TestIsValidDefault(t *testing.T) {
 	tests := []struct {
 		name     string
 		schemaFn func() Schema
-		def      interface{}
-		want     interface{}
+		def      any
+		want     any
 		wantOk   bool
 	}{
 
diff --git a/types_test.go b/types_test.go
index c97855a..eb864bd 100644
--- a/types_test.go
+++ b/types_test.go
@@ -23,7 +23,7 @@ type TestNestedRecord struct {
 }
 
 type TestUnion struct {
-	A interface{} `avro:"a"`
+	A any `avro:"a"`
 }
 
 type TestEmbeddedRecord struct {