Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
encoding/asn1: class and tag constants shouldn't be private. #9236
I'm trying to extract an otherName from the subjectAltName of a certificate. Currently the code looks like this
As you can see there's a lot of magic numbers there. Almost all of those are defined constants in asn1/common.go, but they're set to private, so I can't use them. I don't think they should be private since they're well defined ASN.1 constants.
If they were public, it might be nice to make them typed constants so they can have methods, but https://golang.org/pkg/encoding/asn1/#RawValue already uses Tag and Class as just