New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crypto/x509/pkix: clarify docs for ExtraNames field in pkix.Name #33094
Comments
/cc @FiloSottile |
I don't think this is a bug that requires a code fix. I do agree that the behavior could be clearer though, so changed this issue to a documentation improvement (which I'll send a PR for shortly). This behaves very similarly to
This is the important part of the pkix.Name docs that could be expanded:
So what's happening here is that |
Change https://golang.org/cl/229864 mentions this issue: |
Previously, non-standard attributes in Name.Names were being omitted when printed using Name.String(). Now, any non-standard attributes that would not already be printed in Name.String() are being added temporarily to Name.ExtraNames to be printed. Fixes golang#33094 Fixes golang#23069 Change-Id: Id9829c20968e16db7194549f69c0eb5985044944 Reviewed-on: https://go-review.googlesource.com/c/go/+/229864 Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
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?
I unmarshaled a pkix.Name containing a custom ExtraName, and printed it out.
https://play.golang.org/p/BUS-NDgjPLI
What did you expect to see?
1.2.3.4=#130673616d706c65,CN=foobar
What did you see instead?
CN=foobar
The text was updated successfully, but these errors were encountered: