go-jsonpointer
go-jsonpointer copied to clipboard
Get(), Set(), Delete(), DeleteAny() ops on map.
Use jsonpointer to Get, Set, Delete specific fields inside map[string]interface{}.
- Get(), Set(), Delete(), DeleteAny() are not thread safe.
- Get(), Set(), Delete() are idempotent operations.
I like this idea, but it changes the API of Get and decreases the coverage while adding new, uncovered functions. Can you include some tests? I'm at 100% test coverage now. Would be nice to keep. :)
Have been making few changes on go-jsonpointer.
- optimized parsePointer(), 2x faster.
- refactored bytes_test.go for test-fixtures.
- added more benchmarks, for bytes.go, based on json samples under testdata/.
- added gojson_test.go to benchmark gojson package with golang's, encoding/json.
- Added Set(), Delete(), DeleteAny() APIs along with Incr(), Incrs(), Decr() APIs.
- refactored Get().
- refactored other APIs to use getContainer() and mutateField() functions.
Let me know your thoughts.
Thanks,
100% code coverage.
ListPointers() is listing invalid pointers for empty arrays. Is this expected behaviour ?
squashed offending formatting error. d0dbf11 HEAD@{5}: rebase -i (squash): Added test cases for Set(), Delete(), DeleteAny()
I have tried to address most of the comments. Cheers.
Possibly, but in an additive way. Can you rework the set and come up with the smallest set of patches that are distinct? e.g., add the code and the tests together without introducing anything broken or test reduction or formatting Should be a simple rebase -i
On Thu Jun 26 2014 at 10:02:09 PM, prataprc [email protected] wrote:
I have tried to address most of the comments. Cheers.
— Reply to this email directly or view it on GitHub https://github.com/dustin/go-jsonpointer/pull/5#issuecomment-47308142.
Squashed the main API implementation and its test cases / benchmarks into a single commit. Cheers.
Did you push the squashed commits? This is what I pulled:
4ca989e Removed t.Fail() calls that come after t.Errorf(). 6ac1350 fixes based on pull-request comments. a3dfb09 100% coverage. 16b8d33 optimized parsePointer(). 5697da6 Benchmark between gojson Vs encoding/json. 75a5ed2 Get(), Set(), Delete(), DeleteAny() ops on map.
I'd like to avoid the dip in coverage and things that need to be fixed on stuff that comes in.
(github's code review thing is entirely too primitive)
Yes that is the list of log messages I have as well. And the hash values match.
If you want I can squash all the commits into a single commit. That way we can avoid a dip in coverage.
I don't think it needs to be one. Each commit needs to make sense on its own, though. I think your mutation operations with their tests can be in one commit. The benchmarking can be a commit and the optimization can be a commit. I just like them to be clean and not push through cleanups shortly after.