diff --git a/fxgcppubsub/codec/avro.go b/fxgcppubsub/codec/avro.go index 4b01189..3330686 100644 --- a/fxgcppubsub/codec/avro.go +++ b/fxgcppubsub/codec/avro.go @@ -15,18 +15,15 @@ var ( // AvroBinaryCodec is a Codec implementation for encoding and decoding with avro schema in binary format. type AvroBinaryCodec struct { - cache *avro.SchemaCache api avro.API schema avro.Schema } // NewAvroBinaryCodec returns a new AvroBinaryCodec instance. func NewAvroBinaryCodec(schemaDefinition string) (*AvroBinaryCodec, error) { - cache := &avro.SchemaCache{} - api := avro.Config{}.Freeze() - schema, err := avro.ParseBytesWithCache([]byte(schemaDefinition), "", cache) + schema, err := avro.ParseBytesWithCache([]byte(schemaDefinition), "", &avro.SchemaCache{}) if err != nil { return nil, fmt.Errorf("cannot parse avro schema: %w", err) }