reference: ParseDockerRef: slight refactor, and update docs
- improve documentation - remove redundant error-check - simplify interface matching, which slightly improves readability - touch-up some docs Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2bf5e1879e
commit
53757ea337
4 changed files with 43 additions and 29 deletions
|
@ -146,7 +146,7 @@ type namedRepository interface {
|
|||
Path() string
|
||||
}
|
||||
|
||||
// Domain returns the domain part of the Named reference
|
||||
// Domain returns the domain part of the [Named] reference.
|
||||
func Domain(named Named) string {
|
||||
if r, ok := named.(namedRepository); ok {
|
||||
return r.Domain()
|
||||
|
@ -155,7 +155,7 @@ func Domain(named Named) string {
|
|||
return domain
|
||||
}
|
||||
|
||||
// Path returns the name without the domain part of the Named reference
|
||||
// Path returns the name without the domain part of the [Named] reference.
|
||||
func Path(named Named) (name string) {
|
||||
if r, ok := named.(namedRepository); ok {
|
||||
return r.Path()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue