francoispqt / gojay

high performance JSON encoder/decoder with stream API for Golang
MIT License
2.11k stars 112 forks source link

Added MarshalAny() support #31

Closed m1ome closed 6 years ago

m1ome commented 6 years ago

This is not breaking current API but provides a huge effort if you need a fallback for a marshaller. In cases you don't need a speed, but want to be sure that your object will be marshalled, if it's possible by default golang json implementation.

Thank you!

codecov-io commented 6 years ago

Codecov Report

Merging #31 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #31   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          30     30           
  Lines        3388   3370   -18     
=====================================
- Hits         3388   3370   -18
Impacted Files Coverage Δ
encode.go 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ca0442d...111c200. Read the comment docs.

francoispqt commented 6 years ago

We could also check if it's not an implementation of MarshalerJSONArray, a string, or a number and use gojay, else we use standard json encoder. What do you think?

m1ome commented 6 years ago

@francoispqt i will update PR, but it will BC changes IMO. Let me check this one.

m1ome commented 6 years ago

@francoispqt added all failover stuff & speed up

m1ome commented 6 years ago

@francoispqt any news on this one?

francoispqt commented 6 years ago

I am merging it to master. Will add a few tests and create new release. Sorry for delay, working on a code generator and having a lot of other things to do at work.