diff --git a/encoding/protoavro/encode.go b/encoding/protoavro/encode.go index 48c4720..3a7f1f7 100644 --- a/encoding/protoavro/encode.go +++ b/encoding/protoavro/encode.go @@ -5,8 +5,8 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" ) -// EncodeJSON returns the Avro JSON encoding of message. -func EncodeJSON(message proto.Message) (interface{}, error) { +// encodeJSON returns the Avro JSON encoding of message. +func encodeJSON(message proto.Message) (interface{}, error) { return messageJSON(message.ProtoReflect()) } diff --git a/encoding/protoavro/encoding_test.go b/encoding/protoavro/encoding_test.go index 09f748d..74f7e97 100644 --- a/encoding/protoavro/encoding_test.go +++ b/encoding/protoavro/encoding_test.go @@ -520,7 +520,7 @@ func Test_JSON(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { // t.Parallel() - got, err := EncodeJSON(tt.msg) + got, err := encodeJSON(tt.msg) assert.NilError(t, err) assert.DeepEqual(t, tt.expected, got) diff --git a/encoding/protoavro/marshal.go b/encoding/protoavro/marshal.go index d2bc686..368681a 100644 --- a/encoding/protoavro/marshal.go +++ b/encoding/protoavro/marshal.go @@ -46,7 +46,7 @@ func (m *Marshaler) Marshal(messages ...proto.Message) error { if a != b { return fmt.Errorf("expected message '%s' but got '%s'", a, b) } - m, err := EncodeJSON(message) + m, err := encodeJSON(message) if err != nil { return fmt.Errorf("encode json: %w", err) }