-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add rid constructors #134
Add rid constructors #134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @k-simons)
rid/resource_identifier.go, line 50 at r1 (raw file):
} func Of(service, instance, resourceType, locator string) (ResourceIdentifier, error) {
more idiomatic go would be New(...)
rid/resource_identifier.go, line 61 at r1 (raw file):
func (rid ResourceIdentifier) String() string { return strings.Join([]string{RidClass, rid.Service, rid.Instance, rid.Type, rid.Locator}, Separator)
I did the appends myself for performance reasons; strings.Join is quite slow.
rid/resource_identifier.go, line 82 at r1 (raw file):
// ParseRID parses a string into a 4-part resource identifier. func ParseRID(s string) (ResourceIdentifier, error) { segments := strings.SplitN(s, ".", 5)
can use the Separator constant here
rid/resource_identifier.go, line 83 at r1 (raw file):
func ParseRID(s string) (ResourceIdentifier, error) { segments := strings.SplitN(s, ".", 5) if len(segments) != 5 || segments[0] != "ri" {
can use the RidClass constant here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @bmoylan)
rid/resource_identifier.go, line 50 at r1 (raw file):
Previously, bmoylan (Brad Moylan) wrote…
more idiomatic go would be
New(...)
Done.
rid/resource_identifier.go, line 61 at r1 (raw file):
Previously, bmoylan (Brad Moylan) wrote…
I did the appends myself for performance reasons; strings.Join is quite slow.
Done.
rid/resource_identifier.go, line 82 at r1 (raw file):
Previously, bmoylan (Brad Moylan) wrote…
can use the Separator constant here
Done.
rid/resource_identifier.go, line 83 at r1 (raw file):
Previously, bmoylan (Brad Moylan) wrote…
can use the RidClass constant here
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @bmoylan)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
rid/resource_identifier.go, line 38 at r2 (raw file):
Is there a reason these constants need to be exported? Seems like they should be private. Also, if exported, should be |
rid/resource_identifier.go, line 42 at r2 (raw file):
Where is |
I see that this merged, but have some feedback that I think we should work through/address before cutting a release. |
@nmiyake will open a follow up to discuss |
This change is