Use generics to generalize int32/int64/float32/float64 to number encoder/decoder/store - #83
Open
akrennmair wants to merge 12 commits into
Open
Use generics to generalize int32/int64/float32/float64 to number encoder/decoder/store#83akrennmair wants to merge 12 commits into
akrennmair wants to merge 12 commits into
Conversation
…s for int32/int64/float32/float64; remove vendor directory.
Member
Author
|
Looks like golangci-lint isn't quite mature enough to lint this code. Converting to draft for now... |
akrennmair
marked this pull request as draft
March 20, 2022 13:08
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #83 +/- ##
==========================================
+ Coverage 86.73% 87.27% +0.53%
==========================================
Files 48 46 -2
Lines 9777 9444 -333
==========================================
- Hits 8480 8242 -238
+ Misses 939 884 -55
+ Partials 358 318 -40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
akrennmair
marked this pull request as ready for review
March 20, 2022 20:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces Go 1.18 generics to generalize the separate int32/int64/float32/float64 implementation into a single number type with small specializations. This deduplicates a lot of similar code across these types.
Since this required a switch to Go 1.18, I also replaced
interface{}with the newanytype. I also migrated the existing fuzz tests for gofuzz with Go 1.18 fuzz tests.And finally, I removed the
vendorsubdirectory as it caused issues and doesn't really make sense for a library.