Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON-encoded version of NULL uniqueidentifier #238

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sedbygo
Copy link

@sedbygo sedbygo commented Mar 4, 2025

  • as literal name according RFC 7159
  • remove panic: encoding/hex: invalid byte: U+006E 'n'

* as literal name according RFC 7159
@sedbygo
Copy link
Author

sedbygo commented Mar 4, 2025

@microsoft-github-policy-service agree

@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.91%. Comparing base (ba24acc) to head (465165c).

Files with missing lines Patch % Lines
uniqueidentifier_null.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
+ Coverage   74.77%   74.91%   +0.14%     
==========================================
  Files          32       32              
  Lines        6457     6462       +5     
==========================================
+ Hits         4828     4841      +13     
+ Misses       1338     1333       -5     
+ Partials      291      288       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Valid: false,
}

b, err := json.Marshal(null)
Copy link
Collaborator

@shueybubbles shueybubbles Mar 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json.Marshal

validating Marshal with our own Unmarshal seems a bit underspecified. It could be writing some string that third parties don't believe represent a null value. Is that ok?
an alternative is to just verify that Marshal writes the string "null" since the test above this one verifies that UnmarshalJSON correctly translates "null"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi David, thank you for your feedback! I will make the mentioned improvement and submit it for another review.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Please, see the changes. Thx!

Copy link
Collaborator

@shueybubbles shueybubbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants