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

Error when unmarshal empty array #251

Closed
IncSW opened this issue Jun 15, 2021 · 1 comment
Closed

Error when unmarshal empty array #251

IncSW opened this issue Jun 15, 2021 · 1 comment

Comments

@IncSW
Copy link
Contributor

IncSW commented Jun 15, 2021

func TestIssueХХХ(t *testing.T) {
	array := [3]int{1, 2, 3}
	err := stdjson.Unmarshal([]byte("[ ]"), &array)
	if err != nil {
		t.Fatal(err)
	}
	t.Log(array)

	array = [3]int{1, 2, 3}
	err = json.Unmarshal([]byte("[ ]"), &array)
	if err != nil {
		t.Fatal(err) // json: cannot unmarshal number ] into Go value of type int
	}
	t.Log(array)
}
@goccy
Copy link
Owner

goccy commented Jun 17, 2021

This issue fixed with #253 and it released as v0.7.1

Thanks !

@goccy goccy closed this as completed Jun 17, 2021
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

2 participants