encoding/asn1: Marshal doesn't handle nil interface values correctly #39071
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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
)?go env
OutputWhat did you do?
asn1.Marshal
a struct containing anil
interface withomitempty
tag.https://play.golang.org/p/x-hrKEJH0Fe
What did you expect to see?
No error and the corresponding field should be omitted from the output.
It works with nil slices (see example).
What did you see instead?
Error:
asn1: cannot marshal nil value
The text was updated successfully, but these errors were encountered: