go icon indicating copy to clipboard operation
go copied to clipboard

I need document for go.

Open usfox opened this issue 9 years ago • 6 comments

This is good projects, But no more information for example, Could you write more example? And I can't find any document for your website about go version.

usfox avatar Feb 20 '17 23:02 usfox

i need too

trysh avatar May 27 '17 03:05 trysh

jsoniter.Marshal is a drop-in replacement for json.Marshal

jsoniter.Unmarshal is a drop-in replacement for json.Unmarshal

all your experience of using the standard library can be reused

taowen avatar May 27 '17 03:05 taowen

Hey everyone

I was wondering about the performance because I did not find anything about it. So, I did sample benchmarks, and they are pretty awesome, sharing the results:

BenchmarkStandartJsonUnmarshal-8 10000 137219 ns/op 59.39 MB/s 33670 B/op 691 allocs/op BenchmarkJsonIteratorUnmarshal-8 20000 76422 ns/op 106.64 MB/s 36308 B/op 680 allocs/op BenchmarkStandartJsonMarshal-8 300000 4549 ns/op 120.45 MB/s 1544 B/op 6 allocs/op BenchmarkJsonIteratorMarshal-8 500000 2733 ns/op 200.45 MB/s 2832 B/op 11 allocs/op

kemics avatar Jun 03 '17 04:06 kemics

The project is so easy to use although the doc is simple!

pedrogao avatar Apr 29 '18 14:04 pedrogao

hi,I want user json-iterator/go to instead encoding/json to marshal struct. The structure is at the bottom.I already can use var json = jsoniter.ConfigCompatibleWithStandardLibrary &&json.Marshal() replace func into encoding/json. Now I find a best performence func in json-iterator which use jsoniter.RegisterTypeEncoder or jsoniter.RegisterTypeDecoder instead of defining MarshalJSON or UnmarshalJSON. Marshaler or Unmarshaler by read document. But I don't find any example in document. Is there an example of using this function? Thank you very much.@taowen

Type info struct {
   Name     string
   Agd        int
   Addr       string
   Birth       string
   Others    map[string]interface{}
}

douxu avatar Aug 10 '18 06:08 douxu

this is an example https://github.com/json-iterator/go/blob/be70f29b04dea7efb4d82a8989c33aee989b74d1/extra/time_as_int64_codec.go

taowen avatar Aug 15 '18 13:08 taowen