Skip to content

Commit

Permalink
remove deprecated SplitHostname
Browse files Browse the repository at this point in the history
It was deprecated since distribution [v2.7.0-rc.0][1]

[1]: distribution/distribution@9a43b8f

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Aug 31, 2023
1 parent 0dff0fc commit 0e1c939
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions reference.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ func Path(named Named) (name string) {
return path
}

// splitDomain splits a named reference into a hostname and path string.
// If no valid hostname is found, the hostname is empty and the full value
// is returned as name
func splitDomain(name string) (string, string) {
match := anchoredNameRegexp.FindStringSubmatch(name)
if len(match) != 3 {
Expand All @@ -173,19 +176,6 @@ func splitDomain(name string) (string, string) {
return match[1], match[2]
}

// SplitHostname splits a named reference into a
// hostname and name string. If no valid hostname is
// found, the hostname is empty and the full value
// is returned as name
//
// Deprecated: Use [Domain] or [Path].
func SplitHostname(named Named) (string, string) {
if r, ok := named.(namedRepository); ok {
return r.Domain(), r.Path()
}
return splitDomain(named.Name())
}

// Parse parses s and returns a syntactically valid Reference.
// If an error was encountered it is returned, along with a nil Reference.
func Parse(s string) (Reference, error) {
Expand Down

0 comments on commit 0e1c939

Please sign in to comment.