Registry / serialization / francoispqt-gojay

francoispqt-gojay

JSON →
library1.2.13gogounverified

Package gojay implements high-performance JSON encoding and decoding.

go get github.com/francoispqt/gojay
INSTALL
IMPORT
SIG · FRANCOISPQT-GOJAY
F
francoispqt-gojay
serializationgov1.2.13
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gojay
✓ github.com/francoispqt/gojay

Unmarshal JSON into a struct using gojay's object decoding.

package main import ( "fmt" "github.com/francoispqt/gojay" ) type User struct { Name string Age int } func (u *User) UnmarshalJSONObject(dec *gojay.Decoder, key string) error { switch key { case "name": return dec.String(&u.Name) case "age": return dec.Int(&u.Age) } return nil } func (u *User) NKeys() int { return 2 } func main() { u := &User{} err := gojay.UnmarshalJSONObject([]byte(`{"name":"John","age":30}`), u) if err != nil { fmt.Println("Error:", err) } fmt.Printf("%+v\n", u) }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.2.13latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
francoispqt-gojay — go get francoispqt-gojay · libregistry