Commit Graph

130 Commits

Author SHA1 Message Date
Todd Treece 279389a781
Fix: Switch to lazy init() in decoder and encoder (#490)
* Switch to lazy init() in decoder and encoder

This will prevent go-json from consuming heap unless it is used.

* limit changes to initEncoder and initDecoder
2024-12-11 21:52:23 +09:00
Andrey Grazhdankov 65c8b28ca1
Fix encode []*time.Time - check nil (#524) 2024-11-11 11:10:21 +09:00
Владимир Атаманов 3c67b038e0
Fix custom map marshaling (#505)
* fix custom map parshaling

* add additional tests
2024-05-09 19:53:38 +09:00
lizixing c352e8fb18
fix: fix a bug for escaping 0xE2 0x80 0xA8 in compactString (#479) 2024-05-09 10:28:44 +09:00
Masaaki Goshima 3d5ab28ab3
add license for encoding int processing 2023-10-13 12:44:19 +09:00
Masaaki Goshima 9b91208837
Add license for string processing (#476)
* add license for string processing

* update golangci-lint
2023-10-13 12:33:43 +09:00
Nao Yonashiro 5e6fe10846
fix: fixed a problem with NextField being wrong when combining structure embedding and omitempty (#442)
fix #441
2023-03-20 04:54:48 +09:00
Nao Yonashiro 4d199a4b2c
feat: added the option to output opcodes as dot (#440) 2023-03-20 04:53:43 +09:00
Nao Yonashiro 6f969b6d5f
fix: fixed an issue that could not set the correct NextField for fields in the embedded structure (#438)
fix #391
2023-03-13 20:54:51 +09:00
Nao Yonashiro f32a307caf
fix: fixed a problem that MarshalIndent does not work when UnorderedMap is specified (#435) 2023-03-13 19:58:11 +09:00
Nao Yonashiro 06ab2b4c88
fix: fixed handling of anonymous fields other than struct
fix #426
2023-02-24 09:20:14 +09:00
brongineers 705f51716b fix custom marshal for map key 2022-11-13 21:05:50 +03:00
Trim21 9a9f9adb05
fix encoder and decoder cache slice edge case 2022-07-10 09:15:33 +08:00
Masaaki Goshima 88aa13e300
Fix comment for #379 2022-07-07 14:52:28 +09:00
Nao Yonashiro 565e07e45c fix: change isPtr to true on listElemCode
fix #370
2022-07-06 16:47:00 +09:00
Nao Yonashiro 884b8dbf9a refactor: to check for IsDirectedNil only if ifacePtr == nil 2022-07-03 22:39:31 +09:00
Nao Yonashiro c8d6da88dd fix: confusing nil in direct interface with typed nil
fix #376
2022-07-03 06:05:26 +09:00
Nao Yonashiro 2ea7ab6e24 fix: wrong the detection method of nilable
fix #339
2022-05-04 23:40:12 +09:00
Nao Yonashiro c07df9add6 feat: improve performance on linkRecursiveCode
fix #331
2022-05-03 04:03:05 +09:00
Nao Yonashiro 66f8b2629d chore: use reflect.Ptr 2022-04-28 20:30:06 +09:00
Nao Yonashiro af33c47846 fix: determining embedded structs was wrong
fix #362
2022-04-26 14:16:28 +09:00
Nao Yonashiro 6db1acfcb6 fix: to care about the case of OpInterfacePtr
fix #359
2022-04-22 00:38:20 +09:00
Masaaki Goshima 3a4ad31980
Merge pull request #356 from orisano/feat/add-debug-with
feat: add DebugWith option
2022-03-26 00:57:17 +09:00
Nao Yonashiro 321fe31260 feat: add DebugWith option 2022-03-25 05:13:32 +09:00
Nao Yonashiro e43fb0f990 fix: add filtering on slow path 2022-03-25 03:03:25 +09:00
Nao Yonashiro 48f6412cd1 fix: to safe when got unexpected typeptr 2022-03-19 09:33:16 +09:00
Masaaki Goshima 0940ff3198
Fix the case where the embedded field is at the end 2022-01-20 23:23:51 +09:00
IncSW 4d0a50640b
fix omitempty string is nil for marshaler 2022-01-18 13:38:44 +03:00
Masaaki Goshima f810369f2d
Fix encoding of MarshalText operation with head offset 2022-01-11 15:11:17 +09:00
Masaaki Goshima acc66cf172
Fix MarshalIndent for interface type 2022-01-04 22:30:16 +09:00
Masaaki Goshima 6af83d9bdd
Refactor encoder 2022-01-03 22:42:04 +09:00
Masaaki Goshima 89bcc3be86
Supports dynamic filtering of struct fields 2022-01-03 12:33:51 +09:00
Masaaki Goshima 2a0ee24e6e
Add encoding option for performance 2021-12-30 11:54:29 +09:00
Masaaki Goshima 1bb8b16200
Optimize variables 2021-12-27 22:40:43 +09:00
Masaaki Goshima 2d022aa037
Remove unnecessary codes 2021-12-27 22:28:25 +09:00
Masaaki Goshima 0d18c6d7ce
Optimize encoding path for escaped string 2021-12-27 21:48:21 +09:00
Masaaki Goshima 5418c49bcf
Refactor opcode fields 2021-12-27 17:50:55 +09:00
Masaaki Goshima c220d90e4c
Use MapItem object in Mapslice directly 2021-12-27 12:18:30 +09:00
Masaaki Goshima 657973a17e
Ignore lint error for mapIter 2021-12-27 11:33:17 +09:00
Masaaki Goshima d8aa8348f4
Improve map encoding performance 2021-12-27 11:14:42 +09:00
Masaaki Goshima 918e816ae4
Fix conversion of operation for PtrHead to Head 2021-12-05 11:38:56 +09:00
Masaaki Goshima f6b4e43f6a
Refactor encoder's vm 2021-11-28 21:46:32 +09:00
Masaaki Goshima e4c458f34c
Remove StructAnonymousEnd operation 2021-11-28 12:53:18 +09:00
Masaaki Goshima be85245267
Enable StructEnd optimization for ptr type 2021-11-28 12:35:20 +09:00
Masaaki Goshima ea19d1161a
Fix error by linter 2021-11-28 02:48:01 +09:00
Masaaki Goshima b5e1478450
Refactor compiler for encoder
- Introduced a two phase compilation to calculate Opcode index accurately
- Fix display number of Opcode
- Improve memory footprint for Opcode
2021-11-28 02:14:57 +09:00
Masaaki Goshima 86a671f3bb
Fix embedded field conflict behavior 2021-11-18 19:51:29 +09:00
Masaaki Goshima d7372a47cd
Fix conversion from pointer to uint64 2021-10-14 15:00:28 +09:00
Nao Yonashiro 0065357ebb fix: to avoid panic on untyped nil #290
fix #290
2021-09-27 10:55:37 +09:00
Masaaki Goshima 559d70d706 Fix encoding of empty struct interface type 2021-09-01 11:41:33 +09:00