Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

fuzzy mode doesn't support decode number from boolean #161

@cch123

Description

@cch123
package main

import (
	"fmt"

	"github.com/json-iterator/go"
	"github.com/json-iterator/go/extra"
)

var jsonstr = `
{
	"utc_offset" : false
}
`

type OrderEventRequestParams struct {
	UTCOffset int `json:"utc_offset"`
}

func main() {
	extra.RegisterFuzzyDecoders()
	var a OrderEventRequestParams
	err := jsoniter.UnmarshalFromString(jsonstr, &a)
	fmt.Println(err)
	fmt.Printf("%#v\n", a)
}

main.OrderEventRequestParams: UTCOffset: readUint64: unexpected character: �, parsing 0 ...... at
main.OrderEventRequestParams{UTCOffset:0}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions