From f026ea95cf70be60a1530c31c266ec3097e75d75 Mon Sep 17 00:00:00 2001 From: k-simons Date: Wed, 19 Dec 2018 10:10:48 -0800 Subject: [PATCH] Don't export string constants (#135) --- rid/resource_identifier.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rid/resource_identifier.go b/rid/resource_identifier.go index 95378930..3f724d76 100644 --- a/rid/resource_identifier.go +++ b/rid/resource_identifier.go @@ -35,8 +35,8 @@ type ResourceIdentifier struct { } const ( - RidClass = "ri" - Separator = "." + ridClass = "ri" + separator = "." ) func MustNew(service, instance, resourceType, locator string) ResourceIdentifier { @@ -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). @@ -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{