Skip to content

Commit 4f1d07f

Browse files
authored
Fix typos in comments in json-enumerator source (#4764)
1 parent 4563dde commit 4f1d07f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/sources/json_enumerator/json_enumerator.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ type jsonEntry struct {
8787
}
8888

8989
// jsonEntryAux is a helper struct to support marshalling the content to scan as either
90-
// a UTF-8 string in `content` or a base64-encoded bytestring in `content_base64`.
90+
// a UTF-8 string in `data` or a base64-encoded bytestring in `data_b64`.
9191
type jsonEntryAux struct {
9292
Metadata *json.RawMessage `json:"metadata"`
9393
Data *string `json:"data,omitempty"`
9494
DataB64 *[]byte `json:"data_b64,omitempty"`
9595
}
9696

97-
// MarshalJSON implements custom JSON marshaling for envelope.
98-
// If Content is valid UTF-8, it's serialized as "content" (string).
99-
// If Content is not valid UTF-8, it's base64-encoded and serialized as "content_b64".
97+
// MarshalJSON implements custom JSON marshaling for jsonEntry.
98+
// If Data is valid UTF-8, it's serialized as a `data` string field.
99+
// If Data is not valid UTF-8, it's serialized as a `data_b64` base64-encoded string field.
100100
func (e *jsonEntry) MarshalJSON() ([]byte, error) {
101101
if utf8.Valid(e.Data) {
102102
s := string(e.Data)
@@ -112,8 +112,7 @@ func (e *jsonEntry) MarshalJSON() ([]byte, error) {
112112
}
113113
}
114114

115-
// UnmarshalJSON implements custom JSON unmarshaling for envelope.
116-
// It handles both "content" (string) and "content_b64" (base64-encoded string) fields.
115+
// UnmarshalJSON implements custom JSON unmarshaling for jsonEntry.
117116
func (e *jsonEntry) UnmarshalJSON(data []byte) error {
118117
var aux jsonEntryAux
119118
if err := json.Unmarshal(data, &aux); err != nil {

0 commit comments

Comments
 (0)