Skip to content

Commit

Permalink
fix!: unexport json encoding
Browse files Browse the repository at this point in the history
Missed in previous PR.
#8
  • Loading branch information
ericwenn committed Aug 10, 2021
1 parent f1b9b0a commit fb0b7c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions encoding/protoavro/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down
2 changes: 1 addition & 1 deletion encoding/protoavro/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion encoding/protoavro/marshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit fb0b7c8

Please sign in to comment.