Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions decode_array.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func (dec *Decoder) decodeArrayNull(v interface{}) (int, error) {
vv := reflect.ValueOf(v)
vvt := vv.Type()
if vvt.Kind() != reflect.Ptr || vvt.Elem().Kind() != reflect.Ptr {

dec.err = ErrUnmarshalPtrExpected
return 0, dec.err
}
Expand Down
1 change: 0 additions & 1 deletion decode_bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ func (dec *Decoder) assertFalse() error {
}

// Add Values functions

// AddBool decodes the JSON value within an object or an array to a *bool.
// If next key is neither null nor a JSON boolean, an InvalidUnmarshalError will be returned.
// If next key is null, bool will be false.
Expand Down
2 changes: 1 addition & 1 deletion decode_bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func TestDecoderBoolNull(t *testing.T) {
},
{
name: "null-error2",
json: "nual",
json: "nall",
expectations: func(t *testing.T, v *bool, err error) {
assert.NotNil(t, err, "err should be nil")
assert.IsType(t, InvalidJSONError(""), err, "err should be of type InvalidJSONError")
Expand Down
3 changes: 3 additions & 0 deletions examples/http-benchmarks/gojay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ func (v *ints) MarshalJSONArray(enc *gojay.Encoder) {
func (v *ints) IsNil() bool {
return v == nil || len(*v) == 0
}
func (v *ints) {
return v = v*2
}
1 change: 1 addition & 0 deletions examples/http-json/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type message struct {
bar string
}


func (m *message) UnmarshalJSONObject(dec *gojay.Decoder, k string) error {
switch k {
case "foo":
Expand Down
1 change: 1 addition & 0 deletions gojay/gojay.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func main() {
flag.Parse()
options := codegen.NewOptionsWithFlagSet(flag.CommandLine)
gen := codegen.NewGenerator(options)
// generate error
if err := gen.Generate(); err != nil {
log.Fatal(err)
}
Expand Down