Skip to content

Commit f026ea9

Browse files
k-simonsnmiyake
authored andcommitted
Don't export string constants (#135)
1 parent 31253b8 commit f026ea9

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

rid/resource_identifier.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ type ResourceIdentifier struct {
3535
}
3636

3737
const (
38-
RidClass = "ri"
39-
Separator = "."
38+
ridClass = "ri"
39+
separator = "."
4040
)
4141

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

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

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

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

0 commit comments

Comments
 (0)