We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Go versions:
go version devel +2e4b659 Wed Jul 15 06:04:51 2015 +0000 linux/amd64
go version go1.4.2 linux/amd64
Code: http://play.golang.org/p/ZxYJ0EFsfv.
Expected: an error, something like unsupported type: []string.
unsupported type: []string
Got: panic: reflect.Value.SetBytes of non-byte slice. Same with []int or any other non-byte slice.
panic: reflect.Value.SetBytes of non-byte slice
May be related to #6341.
The text was updated successfully, but these errors were encountered:
I think we just need to change copyValue in encoding/xml/read.go to check the element type of the slice before calling SetBytes.
Sorry, something went wrong.
Instead of panicking, running the code on http://play.golang.org/p/ZxYJ0EFsfv returns:
main.Foo{Type:[]string{"Bar"}}
Should we consider the issue fixed?
@ianlancetaylor This seems fixed. Should I close the issue? Or should someone first check, if the case is covered in tests?
I think this was probably fixed by https://golang.org/cl/30946, which has test cases, so, closing.
No branches or pull requests
Go versions:
go version devel +2e4b659 Wed Jul 15 06:04:51 2015 +0000 linux/amd64
go version go1.4.2 linux/amd64
Code: http://play.golang.org/p/ZxYJ0EFsfv.
Expected: an error, something like
unsupported type: []string
.Got:
panic: reflect.Value.SetBytes of non-byte slice
. Same with []int or any other non-byte slice.May be related to #6341.
The text was updated successfully, but these errors were encountered: