You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interestingly if you make the argument to Marshal a pointer ie &A{} instead of A{}, it doesn't panic and returns an error https://play.golang.org/p/f55UZE6hl6
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
no panic.
What did you see instead?
panic: reflect.Value.Interface: cannot return value obtained from unexported field or method
goroutine 1 [running]:
panic(0xb14a0, 0xc420072080)
/Users/hiro/go/src/runtime/panic.go:527 +0x1a0
reflect.valueInterface(0xcdd20, 0xc42008a0e0, 0xb9, 0x133001, 0xcdd20, 0x1)
/Users/hiro/go/src/reflect/value.go:918 +0x1b5
reflect.Value.Interface(0xcdd20, 0xc42008a0e0, 0xb9, 0x130100, 0xcdd20)
/Users/hiro/go/src/reflect/value.go:907 +0x44
encoding/asn1.makeField(0xcdd20, 0xc42008a0e0, 0xb9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/hiro/go/src/encoding/asn1/marshal.go:582 +0x9c6
encoding/asn1.makeBody(0xbb180, 0xc42008a0e0, 0x99, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc42003bbe0, ...)
/Users/hiro/go/src/encoding/asn1/marshal.go:453 +0xa95
encoding/asn1.makeField(0xbb180, 0xc42008a0e0, 0x99, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc42008a0e0, ...)
/Users/hiro/go/src/encoding/asn1/marshal.go:596 +0x2b4
encoding/asn1.Marshal(0xbb180, 0xc42008a0e0, 0xbb180, 0xc42008a0e0, 0x0, 0x0, 0x0)
/Users/hiro/go/src/encoding/asn1/marshal.go:641 +0xe6
main.main()
/Users/hiro/a.go:13 +0x69
exit status 2
Does this issue reproduce with the latest release (go1.7.1)?
System details
The text was updated successfully, but these errors were encountered: