NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Go modules · #986 by repository stars
Last release 1 years ago
26 Aug 2025
Release timing varies
gaps range from 8 days to 1.3 years
Most releases are documented
notes for 11 of 16 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
61 releases · first in 2020
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix skipping deleted data in elements by @klauspost in #82
Full Changelog: v0.4.4...v0.4.5
Nothing published for this version
Revert change to CPUID functionality and update CI tests.
Revert change to CPUID functionality and update CI tests.
Nothing published for this version
Allow nulling all types. by @klauspost in #77
Full Changelog: v0.4.2...v0.4.3
func (a * Array ) DeleteElems(fn func(i Iter ) bool )
DeleteElems calls the provided function for every element. If the function returns true the element is deleted in the array. Example ¶
if !SupportedCPU() {
// Fake it
fmt.Println("Found array\nModified: {"Image":{"Animated":false,"Height":600,"IDs":[943,38793]},"Alt":"Image of city"}")
return
}
input := { "Image": { "Animated": false, "Height": 600, "IDs": [ 116, 943, 234, 38793 ] }, "Alt": "Image of city" }
pj, err := Parse([]byte(input), nil)
if err != nil {
log.Fatal(err)
}
i := pj.Iter()
i.AdvanceInto()
// Grab root _, root, err := i.Root(nil) if err != nil { log.Fatal(err) } // Grab top object obj, err := root.Object(nil) if err != nil { log.Fatal(err) }
// Find element in path. elem, err := obj.FindPath(nil, "Image", "IDs") if err != nil { log.Fatal(err) } fmt.Println("Found", elem.Type) if elem.Type == TypeArray { array, err := elem.Iter.Array(nil) if err != nil { log.Fatal(err) } // Delete all integer elements that are < 500 array.DeleteElems(func(i Iter) bool { if id, err := i.Int(); err == nil { return id < 500 } return false }) } b, err := root.MarshalJSON() if err != nil { log.Fatal(err) } fmt.Println("Modified:", string(b))
Output: Found array Modified: {"Image":{"Animated":false,"Height":600,"IDs":[943,38793]},"Alt":"Image of city"}
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fix incorrect reallocation by @klauspost in #58
Remove parsing allocs by @klauspost in #55
Full Changelog: v0.4.0...v0.4.1
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add Object/Array foreach by @klauspost in #49
Full Changelog: v0.3.0...v0.4.0
func (a * Array ) ForEach(fn func(i Iter ))
ForEach calls the provided function for every element.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add value editing by @klauspost in #46
Full Changelog: v0.2.2...v0.3.0
func (i * Iter ) FindElement(dst * Element , path ... string ) (* Element , error )
FindElement allows searching for fields and objects by path from the iter and forward, moving into root and objects, but not arrays. For example "Image", "Url" will search the current root/object for an "Image" object and return the value of the "Url" element. ErrPathNotFound is returned if any part of the path cannot be found. If the tape contains an error it will be returned. The iter will not be advanced. Example ¶
if !SupportedCPU() {
// Fake it
fmt.Println("int\n100 <nil>")
return
}
input := { "Image": { "Animated": false, "Height": 600, "IDs": [ 116, 943, 234, 38793 ], "Thumbnail": { "Height": 125, "Url": "http://www.example.com/image/481989943", "Width": 100 }, "Title": "View from 15th Floor", "Width": 800 }, "Alt": "Image of city" }
pj, err := Parse([]byte(input), nil)
if err != nil {
log.Fatal(err)
}
i := pj.Iter()
// Find element in path. elem, err := i.FindElement(nil, "Image", "Thumbnail", "Width") if err != nil { log.Fatal(err) }
// Print result: fmt.Println(elem.Type) fmt.Println(elem.Iter.StringCvt())
Output: int 100 <nil>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
type ParserOption func(pj *internalParsedJson) error
type ParserOption func(pj *internalParsedJson) error
ParserOption is a parser option.
Nothing published for this version
Nothing published for this version
Indicate float conversion due to overflows
func (a * Array ) AsStringCvt() ([] string , error )
AsStringCvt returns the array values as a slice of strings. Scalar types are converted. Root, Object and Arrays are not supported an will return an error if found.
Nothing published for this version
Nothing published for this version
Number parsing fix and optimization
Number parsing fix and optimization (#27)
Remove `GOLANG_NUMBER_PARSING` and remove the imprecise parsing and fix up the actual number parsing in Go.
By default, everything that looked like a number would be accepted and a lot of errors were not caught.
Uints will now actually be used if numbers are above maximum int64 and below uint64 with no float point markers.
Even with all the additional checks we are still faster:
```
λ benchcmp before.txt after.txt
benchmark old ns/op new ns/op delta
BenchmarkParseNumber/Pos/63bit-32 91.9 75.9 -17.41%
BenchmarkParseNumber/Neg/63bit-32 106 77.2 -27.17%
BenchmarkParseNumberFloat-32 190 72.5 -61.84%
BenchmarkParseNumberFloatExp-32 212 98.6 -53.49%
BenchmarkParseNumberBig-32 401 175 -56.36%
BenchmarkParseNumberRandomBits-32 420 230 -45.24%
BenchmarkParseNumberRandomFloats-32 305 172 -43.61%
```
... and full benchmarks:
```
benchmark old ns/op new ns/op delta
BenchmarkApache_builds-32 137091 139556 +1.80%
BenchmarkCanada-32 30705862 19000003 -38.12%
BenchmarkCitm_catalog-32 1921474 2093471 +8.95%
BenchmarkGithub_events-32 77611 77873 +0.34%
BenchmarkGsoc_2018-32 1220291 1215097 -0.43%
BenchmarkInstruments-32 366747 374568 +2.13%
BenchmarkMarine_ik-32 27410259 18343775 -33.08%
BenchmarkMesh-32 8200018 5896043 -28.10%
BenchmarkMesh_pretty-32 9793413 6947830 -29.06%
BenchmarkNumbers-32 1967319 1213924 -38.30%
BenchmarkRandom-32 1072071 1042956 -2.72%
BenchmarkTwitter-32 645530 645529 -0.00%
BenchmarkTwitterescaped-32 1014456 1022548 +0.80%
```
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
const ( // CompressNone no compression whatsoever. CompressNone CompressMode = iota // CompressFast will apply light compression, // but will not dedu
type CompressMode uint8
const ( // CompressNone no compression whatsoever. CompressNone CompressMode = iota // CompressFast will apply light compression, // but will not deduplicate strings which may affect deserialization speed. CompressFast // CompressDefault applies light compression and deduplicates strings. CompressDefault // CompressBest CompressBest )
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →