Closed wawan93 closed 11 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Empty strings (even with omitempty tag) are parsed with the error invalid UUID length.
I'm new to this project but @bormanp is this ideal? My gut says that deserializing a JSON blob that omits a UUID
field into a struct that states omitempty
for that same UUID
field shouldn't produce an error and instead should just be Nil
. If we fix this, we fix it in a separate PR of course. Even without omitempty
I don't think it should be an error, just Nil
.
Edit: I guess omitempty is for serialization not deserialization, so it's not a distinction for Unmarshal
.
I've added some test cases in JSON for documentation purposes. Only
"00000000-0000-0000-0000-000000000000"
andnull
values are parsed without errors. Empty strings (even withomitempty
tag) are parsed with the errorinvalid UUID length
.