What version of Go are you using (go version)?
$ go version
go version devel +5b509d993d Tue Oct 13 08:36:41 2020 +0000 darwin/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOOS="darwin"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
What did you do?
Pass a zero reflect.Value to Value.Set, as an argument.
https://play.golang.org/p/hynNVbNp4-L
What did you expect to see?
An error that puts the culprit on Value.Set's argument, not on its receiver. Something like:
panic: reflect: zero Value passed to reflect.Value.Set
What did you see instead?
A ValueError like this:
panic: reflect: call of reflect.Value.Set on zero Value
According to the docs:
A ValueError occurs when a Value method is invoked on a Value that does not support it. Such cases are documented in the description of each method.
But that's not what's really happening here. The receiving Value does support Set. It's the argument which is wrong.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env)?What did you do?
Pass a zero reflect.Value to Value.Set, as an argument.
https://play.golang.org/p/hynNVbNp4-L
What did you expect to see?
An error that puts the culprit on Value.Set's argument, not on its receiver. Something like:
What did you see instead?
A ValueError like this:
According to the docs:
But that's not what's really happening here. The receiving Value does support Set. It's the argument which is wrong.