Skip to content

Commit

Permalink
fix: change null char to '\u0000'
Browse files Browse the repository at this point in the history
  • Loading branch information
lyan-on-jakpat committed Mar 29, 2023
1 parent cd7dda8 commit 965b22a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func MarshalStruct(input interface{}, options *MarshalOptions) ([]byte, error) {
} else if fieldName == "" {
fieldName = lowerCaseFirstLetter(typeOfValue.Field(i).Name)
} else if fieldName == "data" {
fieldName = "\000" + options.StructName + "\000" + fieldName
fieldName = "\u0000" + options.StructName + "\u0000" + fieldName
}

buffer.Write(MarshalString(fieldName))
Expand Down

0 comments on commit 965b22a

Please sign in to comment.