github.com/night-codes/go-json@v0.9.15/CHANGELOG.md (about) 1 # v0.9.11 - 2022/08/18 2 3 ### Fix bugs 4 5 * Fix unexpected behavior when buffer ends with backslash ( #383 ) 6 * Fix stream decoding of escaped character ( #387 ) 7 8 # v0.9.10 - 2022/07/15 9 10 ### Fix bugs 11 12 * Fix boundary exception of type caching ( #382 ) 13 14 # v0.9.9 - 2022/07/15 15 16 ### Fix bugs 17 18 * Fix encoding of directed interface with typed nil ( #377 ) 19 * Fix embedded primitive type encoding using alias ( #378 ) 20 * Fix slice/array type encoding with types implementing MarshalJSON ( #379 ) 21 * Fix unicode decoding when the expected buffer state is not met after reading ( #380 ) 22 23 # v0.9.8 - 2022/06/30 24 25 ### Fix bugs 26 27 * Fix decoding of surrogate-pair ( #365 ) 28 * Fix handling of embedded primitive type ( #366 ) 29 * Add validation of escape sequence for decoder ( #367 ) 30 * Fix stream tokenizing respecting UseNumber ( #369 ) 31 * Fix encoding when struct pointer type that implements Marshal JSON is embedded ( #375 ) 32 33 ### Improve performance 34 35 * Improve performance of linkRecursiveCode ( #368 ) 36 37 # v0.9.7 - 2022/04/22 38 39 ### Fix bugs 40 41 #### Encoder 42 43 * Add filtering process for encoding on slow path ( #355 ) 44 * Fix encoding of interface{} with pointer type ( #363 ) 45 46 #### Decoder 47 48 * Fix map key decoder that implements UnmarshalJSON ( #353 ) 49 * Fix decoding of []uint8 type ( #361 ) 50 51 ### New features 52 53 * Add DebugWith option for encoder ( #356 ) 54 55 # v0.9.6 - 2022/03/22 56 57 ### Fix bugs 58 59 * Correct the handling of the minimum value of int type for decoder ( #344 ) 60 * Fix bugs of stream decoder's bufferSize ( #349 ) 61 * Add a guard to use typeptr more safely ( #351 ) 62 63 ### Improve decoder performance 64 65 * Improve escapeString's performance ( #345 ) 66 67 ### Others 68 69 * Update go version for CI ( #347 ) 70 71 # v0.9.5 - 2022/03/04 72 73 ### Fix bugs 74 75 * Fix panic when decoding time.Time with context ( #328 ) 76 * Fix reading the next character in buffer to nul consideration ( #338 ) 77 * Fix incorrect handling on skipValue ( #341 ) 78 79 ### Improve decoder performance 80 81 * Improve performance when a payload contains escape sequence ( #334 ) 82 83 # v0.9.4 - 2022/01/21 84 85 * Fix IsNilForMarshaler for string type with omitempty ( #323 ) 86 * Fix the case where the embedded field is at the end ( #326 ) 87 88 # v0.9.3 - 2022/01/14 89 90 * Fix logic of removing struct field for decoder ( #322 ) 91 92 # v0.9.2 - 2022/01/14 93 94 * Add invalid decoder to delay type error judgment at decode ( #321 ) 95 96 # v0.9.1 - 2022/01/11 97 98 * Fix encoding of MarshalText/MarshalJSON operation with head offset ( #319 ) 99 100 # v0.9.0 - 2022/01/05 101 102 ### New feature 103 104 * Supports dynamic filtering of struct fields ( #314 ) 105 106 ### Improve encoding performance 107 108 * Improve map encoding performance ( #310 ) 109 * Optimize encoding path for escaped string ( #311 ) 110 * Add encoding option for performance ( #312 ) 111 112 ### Fix bugs 113 114 * Fix panic at encoding map value on 1.18 ( #310 ) 115 * Fix MarshalIndent for interface type ( #317 ) 116 117 # v0.8.1 - 2021/12/05 118 119 * Fix operation conversion from PtrHead to Head in Recursive type ( #305 ) 120 121 # v0.8.0 - 2021/12/02 122 123 * Fix embedded field conflict behavior ( #300 ) 124 * Refactor compiler for encoder ( #301 #302 ) 125 126 # v0.7.10 - 2021/10/16 127 128 * Fix conversion from pointer to uint64 ( #294 ) 129 130 # v0.7.9 - 2021/09/28 131 132 * Fix encoding of nil value about interface type that has method ( #291 ) 133 134 # v0.7.8 - 2021/09/01 135 136 * Fix mapassign_faststr for indirect struct type ( #283 ) 137 * Fix encoding of not empty interface type ( #284 ) 138 * Fix encoding of empty struct interface type ( #286 ) 139 140 # v0.7.7 - 2021/08/25 141 142 * Fix invalid utf8 on stream decoder ( #279 ) 143 * Fix buffer length bug on string stream decoder ( #280 ) 144 145 Thank you @orisano !! 146 147 # v0.7.6 - 2021/08/13 148 149 * Fix nil slice assignment ( #276 ) 150 * Improve error message ( #277 ) 151 152 # v0.7.5 - 2021/08/12 153 154 * Fix encoding of embedded struct with tags ( #265 ) 155 * Fix encoding of embedded struct that isn't first field ( #272 ) 156 * Fix decoding of binary type with escaped char ( #273 ) 157 158 # v0.7.4 - 2021/07/06 159 160 * Fix encoding of indirect layout structure ( #264 ) 161 162 # v0.7.3 - 2021/06/29 163 164 * Fix encoding of pointer type in empty interface ( #262 ) 165 166 # v0.7.2 - 2021/06/26 167 168 ### Fix decoder 169 170 * Add decoder for func type to fix decoding of nil function value ( #257 ) 171 * Fix stream decoding of []byte type ( #258 ) 172 173 ### Performance 174 175 * Improve decoding performance of map[string]interface{} type ( use `mapassign_faststr` ) ( #256 ) 176 * Improve encoding performance of empty interface type ( remove recursive calling of `vm.Run` ) ( #259 ) 177 178 ### Benchmark 179 180 * Add bytedance/sonic as benchmark target ( #254 ) 181 182 # v0.7.1 - 2021/06/18 183 184 ### Fix decoder 185 186 * Fix error when unmarshal empty array ( #253 ) 187 188 # v0.7.0 - 2021/06/12 189 190 ### Support context for MarshalJSON and UnmarshalJSON ( #248 ) 191 192 * json.MarshalContext(context.Context, interface{}, ...json.EncodeOption) ([]byte, error) 193 * json.NewEncoder(io.Writer).EncodeContext(context.Context, interface{}, ...json.EncodeOption) error 194 * json.UnmarshalContext(context.Context, []byte, interface{}, ...json.DecodeOption) error 195 * json.NewDecoder(io.Reader).DecodeContext(context.Context, interface{}) error 196 197 ```go 198 type MarshalerContext interface { 199 MarshalJSON(context.Context) ([]byte, error) 200 } 201 202 type UnmarshalerContext interface { 203 UnmarshalJSON(context.Context, []byte) error 204 } 205 ``` 206 207 ### Add DecodeFieldPriorityFirstWin option ( #242 ) 208 209 In the default behavior, go-json, like encoding/json, will reflect the result of the last evaluation when a field with the same name exists. I've added new options to allow you to change this behavior. `json.DecodeFieldPriorityFirstWin` option reflects the result of the first evaluation if a field with the same name exists. This behavior has a performance advantage as it allows the subsequent strings to be skipped if all fields have been evaluated. 210 211 ### Fix encoder 212 213 * Fix indent number contains recursive type ( #249 ) 214 * Fix encoding of using empty interface as map key ( #244 ) 215 216 ### Fix decoder 217 218 * Fix decoding fields containing escaped characters ( #237 ) 219 220 ### Refactor 221 222 * Move some tests to subdirectory ( #243 ) 223 * Refactor package layout for decoder ( #238 ) 224 225 # v0.6.1 - 2021/06/02 226 227 ### Fix encoder 228 229 * Fix value of totalLength for encoding ( #236 ) 230 231 # v0.6.0 - 2021/06/01 232 233 ### Support Colorize option for encoding (#233) 234 235 ```go 236 b, err := json.MarshalWithOption(v, json.Colorize(json.DefaultColorScheme)) 237 if err != nil { 238 ... 239 } 240 fmt.Println(string(b)) // print colored json 241 ``` 242 243 ### Refactor 244 245 * Fix opcode layout - Adjust memory layout of the opcode to 128 bytes in a 64-bit environment ( #230 ) 246 * Refactor encode option ( #231 ) 247 * Refactor escape string ( #232 ) 248 249 # v0.5.1 - 2021/5/20 250 251 ### Optimization 252 253 * Add type addrShift to enable bigger encoder/decoder cache ( #213 ) 254 255 ### Fix decoder 256 257 * Keep original reference of slice element ( #229 ) 258 259 ### Refactor 260 261 * Refactor Debug mode for encoding ( #226 ) 262 * Generate VM sources for encoding ( #227 ) 263 * Refactor validator for null/true/false for decoding ( #221 ) 264 265 # v0.5.0 - 2021/5/9 266 267 ### Supports using omitempty and string tags at the same time ( #216 ) 268 269 ### Fix decoder 270 271 * Fix stream decoder for unicode char ( #215 ) 272 * Fix decoding of slice element ( #219 ) 273 * Fix calculating of buffer length for stream decoder ( #220 ) 274 275 ### Refactor 276 277 * replace skipWhiteSpace goto by loop ( #212 ) 278 279 # v0.4.14 - 2021/5/4 280 281 ### Benchmark 282 283 * Add valyala/fastjson to benchmark ( #193 ) 284 * Add benchmark task for CI ( #211 ) 285 286 ### Fix decoder 287 288 * Fix decoding of slice with unmarshal json type ( #198 ) 289 * Fix decoding of null value for interface type that does not implement Unmarshaler ( #205 ) 290 * Fix decoding of null value to []byte by json.Unmarshal ( #206 ) 291 * Fix decoding of backslash char at the end of string ( #207 ) 292 * Fix stream decoder for null/true/false value ( #208 ) 293 * Fix stream decoder for slow reader ( #211 ) 294 295 ### Performance 296 297 * If cap of slice is enough, reuse slice data for compatibility with encoding/json ( #200 ) 298 299 # v0.4.13 - 2021/4/20 300 301 ### Fix json.Compact and json.Indent 302 303 * Support validation the input buffer for json.Compact and json.Indent ( #189 ) 304 * Optimize json.Compact and json.Indent ( improve memory footprint ) ( #190 ) 305 306 # v0.4.12 - 2021/4/15 307 308 ### Fix encoder 309 310 * Fix unnecessary indent for empty slice type ( #181 ) 311 * Fix encoding of omitempty feature for the slice or interface type ( #183 ) 312 * Fix encoding custom types zero values with omitempty when marshaller exists ( #187 ) 313 314 ### Fix decoder 315 316 * Fix decoder for invalid top level value ( #184 ) 317 * Fix decoder for invalid number value ( #185 ) 318 319 # v0.4.11 - 2021/4/3 320 321 * Improve decoder performance for interface type 322 323 # v0.4.10 - 2021/4/2 324 325 ### Fix encoder 326 327 * Fixed a bug when encoding slice and map containing recursive structures 328 * Fixed a logic to determine if indirect reference 329 330 # v0.4.9 - 2021/3/29 331 332 ### Add debug mode 333 334 If you use `json.MarshalWithOption(v, json.Debug())` and `panic` occurred in `go-json`, produces debug information to console. 335 336 ### Support a new feature to compatible with encoding/json 337 338 - invalid UTF-8 is coerced to valid UTF-8 ( without performance down ) 339 340 ### Fix encoder 341 342 - Fixed handling of MarshalJSON of function type 343 344 ### Fix decoding of slice of pointer type 345 346 If there is a pointer value, go-json will use it. (This behavior is necessary to achieve the ability to prioritize pre-filled values). However, since slices are reused internally, there was a bug that referred to the previous pointer value. Therefore, it is not necessary to refer to the pointer value in advance for the slice element, so we explicitly initialize slice element by `nil`. 347 348 # v0.4.8 - 2021/3/21 349 350 ### Reduce memory usage at compile time 351 352 * go-json have used about 2GB of memory at compile time, but now it can compile with about less than 550MB. 353 354 ### Fix any encoder's bug 355 356 * Add many test cases for encoder 357 * Fix composite type ( slice/array/map ) 358 * Fix pointer types 359 * Fix encoding of MarshalJSON or MarshalText or json.Number type 360 361 ### Refactor encoder 362 363 * Change package layout for reducing memory usage at compile 364 * Remove anonymous and only operation 365 * Remove root property from encodeCompileContext and opcode 366 367 ### Fix CI 368 369 * Add Go 1.16 370 * Remove Go 1.13 371 * Fix `make cover` task 372 373 ### Number/Delim/Token/RawMessage use the types defined in encoding/json by type alias 374 375 # v0.4.7 - 2021/02/22 376 377 ### Fix decoder 378 379 * Fix decoding of deep recursive structure 380 * Fix decoding of embedded unexported pointer field 381 * Fix invalid test case 382 * Fix decoding of invalid value 383 * Fix decoding of prefilled value 384 * Fix not being able to return UnmarshalTypeError when it should be returned 385 * Fix decoding of null value 386 * Fix decoding of type of null string 387 * Use pre allocated pointer if exists it at decoding 388 389 ### Reduce memory usage at compile 390 391 * Integrate int/int8/int16/int32/int64 and uint/uint8/uint16/uint32/uint64 operation to reduce memory usage at compile 392 393 ### Remove unnecessary optype