README.md

Json

Removed features

New features

encode state is the options carrier, instead of passing around options as parameter

optional sort map keys on serializing

encoding and decoding of Null typed structs (NullString, NullBool, etc.) - see TestNewNull in encode_test.go for the Marshalers and TestNewDecodeNull in decode_test.go

minimal reflect, extracted from reflect package

fast number scanner in strconv - numbers are already validated on decoding, so there is no need to validate (to be described)

minimal strconv package included - instead of working with strings we're working with []byte (to be described)

fixed omitempty struct bug :

type (
// note that all fields are omit emptyEmptyStructstruct {
Idint64`json:"id,omitempty"`Namestring`json:"name,omitempty"`Boolbool`json:"bool,omitempty"`
}
Teststruct {
Iduint64`json:"id"`MyStructEmptyStruct`json:"myStruct,omitempty"`// and this one is marked as omit empty
}
)
// the result should not contain "myStruct":{} - but it doestester:= &Test{Id: 3}
result, err:= json.Marshal(tester)

The result is {"id":3} not {"id":3,"myStruct":{}}.

Possible Known Issues

Working with maps : when using Marshal with maps, developers should make sure that the map doesn't change.
For allocation reasons, I have removed the code that was copying map's key and value before reading it.