Skip to content

encoding/json: error when unmarshaling empty string to int #22182

@xtudouh

Description

@xtudouh

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go1.8

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

amd64

What did you do?

https://play.golang.org/p/IRHV8RRSoy

What did you expect to see?

json.Unmarshal should return nil

What did you see instead?

If try to unmarshal an empty string, it should return 0, instead of an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions