Skip to content
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

proposal: crypto/x509: rename OIDFromInts to NewOIDFromInts #64012

Closed
mateusz834 opened this issue Nov 8, 2023 · 3 comments
Closed

proposal: crypto/x509: rename OIDFromInts to NewOIDFromInts #64012

mateusz834 opened this issue Nov 8, 2023 · 3 comments

Comments

@mateusz834
Copy link
Member

All (or most) constructors functions are prefixed with New, #60665 added a function called OIDFromInts. I think that we should prefix it with New, as we do in other parts of the std.
When I want to construct some type I often look what LSP finds for New*, it might be slightly confusing that it is not prefixed with New. It was added just recently so we are still free to change the name at this point.

CC @rolandshoemaker

@bcmills
Copy link
Contributor

bcmills commented Dec 13, 2023

Generally new “New” prefix on a Go function name implies a function that returns a pointer.

x509.OIDFromInts (as currently drafted) returns a struct value instead ((OID, error)), and it appears that OID is intended to function as a value type.

@rsc
Copy link
Contributor

rsc commented Dec 13, 2023

Yes, same as things like reflect.ValueOf and so on - no New.

@rsc
Copy link
Contributor

rsc commented Dec 14, 2023

This proposal has been declined as infeasible.
— rsc for the proposal review group

@rsc rsc moved this from Incoming to Declined in Proposals Dec 14, 2023
@rsc rsc closed this as completed Dec 14, 2023
@rsc rsc changed the title proposal: crypto/x509: rename OIDFromInts to NewOIDFromInts proposal: crypto/x509: rename OIDFromInts to NewOIDFromInts Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Declined
Status: Done
Development

No branches or pull requests

6 participants