Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoder doesn't display a type mismatch #518

Open
pdebakker-auguria opened this issue Aug 6, 2024 · 0 comments
Open

Decoder doesn't display a type mismatch #518

pdebakker-auguria opened this issue Aug 6, 2024 · 0 comments

Comments

@pdebakker-auguria
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant