diff --git a/accessors.go b/accessors.go index 2864c37..7893942 100644 --- a/accessors.go +++ b/accessors.go @@ -6,9 +6,17 @@ import ( "strings" ) -// arrayAccesRegexString is the regex used to extract the array number -// from the access path -const arrayAccesRegexString = `^(.+)\[([0-9]+)\]$` +const ( + // PathSeparator is the character used to separate the elements + // of the keypath. + // + // For example, `location.address.city` + PathSeparator string = "." + + // arrayAccesRegexString is the regex used to extract the array number + // from the access path + arrayAccesRegexString = `^(.+)\[([0-9]+)\]$` +) // arrayAccesRegex is the compiled arrayAccesRegexString var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString) diff --git a/constants.go b/constants.go deleted file mode 100644 index f9eb42a..0000000 --- a/constants.go +++ /dev/null @@ -1,13 +0,0 @@ -package objx - -const ( - // PathSeparator is the character used to separate the elements - // of the keypath. - // - // For example, `location.address.city` - PathSeparator string = "." - - // SignatureSeparator is the character that is used to - // separate the Base64 string from the security signature. - SignatureSeparator = "_" -) diff --git a/conversions.go b/conversions.go index 2bf37a7..ca1c2de 100644 --- a/conversions.go +++ b/conversions.go @@ -9,6 +9,10 @@ import ( "net/url" ) +// SignatureSeparator is the character that is used to +// separate the Base64 string from the security signature. +const SignatureSeparator = "_" + // JSON converts the contained object to a JSON string // representation func (m Map) JSON() (string, error) {