stretchr / objx

Go package for dealing with maps, slices, JSON and other data.
MIT License
687 stars 75 forks source link

fix int to float conversions #108

Closed geseq closed 2 years ago

geseq commented 3 years ago

fixes https://github.com/stretchr/objx/issues/101 fixes https://github.com/stretchr/objx/issues/99

Due to https://github.com/stretchr/objx/pull/59 integer floats are converted to int, causing float check issues. One way to fix is to move float to int conversions to Int() accessor. This has the side effect of also fixing loss of precision. It also makes the implementation consistent with go's json unmarshal

Summary

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

geseq commented 3 years ago

looks like this'll require https://github.com/stretchr/objx/pull/107 to be merged to fix the CI failure