Closed
Description
Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (
go version
)?
1.6 - What operating system and processor architecture are you using (
go env
)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/.../golang"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="/usr/local/bin/gcc-5"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fno-common"
CXX="/usr/local/bin/c++-5"
CGO_ENABLED="1" - What did you do?
If I have
id_sha1 = asn1.ObjectIdentifier{1, 3, 14, 3, 2, 26}
type Foo struct {
oid asn1.ObjectIdentifier
}
this works correctly, but if I change it to:
type AlgorithmId asn1.ObjectIdentifier
id_sha1 = AlgorithmId{1, 3, 14, 3, 2, 26}
type Foo struct {
oid AlgorithmId
}
which seems to be the way most of the asn1 documentations are written the asn1 marshaling gets confused.
- What did you expect to see?
I would expect the marshaller to be smart enough to recognize that a type is originating from the asn1.ObjectIdentifier and serialize it as such - What did you see instead?
The asn1.ObjectIdentifier is serialized as a binary blob