Skip to content

Decoder doesn't display a type mismatch #518

@pdebakker-auguria

Description

@pdebakker-auguria

We had a situation like

type WLB struct {
	Accessmask          []string `json:"accesmask"`
	...

But sometimes in our dataset, this field was actually just a string.
The error that the json.Decoder.decode() was json: slice unexpected end of JSON input.

Shouldn't the error be that the value doesn't have the expected type instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions