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

Don't export rid constants #135

Merged
merged 1 commit into from
Dec 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions rid/resource_identifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type ResourceIdentifier struct {
}

const (
RidClass = "ri"
Separator = "."
ridClass = "ri"
separator = "."
)

func MustNew(service, instance, resourceType, locator string) ResourceIdentifier {
Expand All @@ -58,7 +58,7 @@ func New(service, instance, resourceType, locator string) (ResourceIdentifier, e
}

func (rid ResourceIdentifier) String() string {
return RidClass + Separator + rid.Service + Separator + rid.Instance + Separator + rid.Type + Separator + rid.Locator
return ridClass + separator + rid.Service + separator + rid.Instance + separator + rid.Type + separator + rid.Locator
}

// MarshalText implements encoding.TextMarshaler (used by encoding/json and others).
Expand All @@ -79,8 +79,8 @@ func (rid *ResourceIdentifier) UnmarshalText(text []byte) error {

// ParseRID parses a string into a 4-part resource identifier.
func ParseRID(s string) (ResourceIdentifier, error) {
segments := strings.SplitN(s, Separator, 5)
if len(segments) != 5 || segments[0] != RidClass {
segments := strings.SplitN(s, separator, 5)
if len(segments) != 5 || segments[0] != ridClass {
return ResourceIdentifier{}, errors.New("invalid resource identifier")
}
rid := ResourceIdentifier{
Expand Down