ffjson
ffjson copied to clipboard
faster JSON serialization for Go
the generated code is var tmpJSpecialDates *time.Time tok = fs.Scan() if tok == fflib.FFTok_error { goto tokerror } if tok == fflib.FFTok_right_brace { break } if tok == fflib.FFTok_comma {...
```go type Demo struct { A int `json:"a,omitempty"` B string `json:"b,omitempty"` } func BenchmarkJsoncost(b *testing.B) { d := Demo{ A: 1, B: "abc", } b.ReportAllocs() for i := 0; i...
When a type is a slice of another type we should use the type name itself and not a slice of the elements of the slice. Fixes #243
```go type T struct { A map[string]interface{} B map[string]string C string D Tx E *string F *Tx } type Tx struct { A map[string]interface{} B map[string]string C string } func...
``` bmeh@arch test $ cat main.go package main import "github.com/pquerna/ffjson/ffjson" func main() { ffjson.DecodeFast() } bmeh@arch test $ ``` ``` $ go build # _/tmp/test ./main.go:6:2: undefined: ffjson.DecodeFast ``` What...
I have an api project uses ffjson to generate code handling json, use the `ffjson -force-regenerate $GOFILE` to always regenerate, //go:generate ffjson -force-regenerate $GOFILE Met two problems: 1. sometimes the...
I'm unable to use [dep](https://github.com/golang/dep) when I have ffjson as a dependency in a project, because when I try to run `dep init` it complains about the dependency **github.com/foo/vendored**, and...
Unmarshalling of map[string]*json.RawMessage fails (didn't test on anything else yet). Steps to reproduce: ``` type customColData struct { Data map[string]*json.RawMessage } var obj customColData{} err := obj.UnmarshalJSON([]byte(`{"Data":{"qwe":123}}`) if err !=...
Hi, When I try to test the repo "tests" it fails with + go test -compiler gc -ldflags '-X github.com/pquerna/ffjson/version.GitSHA=d49c2bc1aa135aad0c6f4fc2056623ec78f5d5ac -extldflags '\''-Wl,-z,relro '\''' FAIL github.com/pquerna/ffjson/tests [build failed] # github.com/pquerna/ffjson/tests ./ff_invalid_test.go:35:12:...
test/test.go ``` package test type Color struct { Red uint8 `json:"red"` Green uint8 `json:"green"` Blue uint8 `json:"blue"` Alpha uint8 `json:"alpha"` } type Colors struct { Font Color `json:"font"` Background Color...