-
Notifications
You must be signed in to change notification settings - Fork 53
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
Use generics to generalize int32/int64/float32/float64 to number encoder/decoder/store #83
base: master
Are you sure you want to change the base?
Conversation
…s for int32/int64/float32/float64; remove vendor directory.
Looks like golangci-lint isn't quite mature enough to lint this code. Converting to draft for now... |
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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 newany
type. I also migrated the existing fuzz tests for gofuzz with Go 1.18 fuzz tests.And finally, I removed the
vendor
subdirectory as it caused issues and doesn't really make sense for a library.