Implementation collapse: Drop taggedRef

Now that taggedRef merely wraps a distreference.NamedTagged, adding no
functionality, just use a distreference.NamedTagged directly.  This also
simplifies XWithTag to merely call distreference.WithTag.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2017-01-20 06:49:19 +01:00
parent 0268d9077d
commit 751e8a5a2e
1 changed files with 2 additions and 11 deletions

View File

@ -74,22 +74,13 @@ func XWithName(name string) (*namedRef, error) {
// XWithTag combines the name from "name" and the tag from "tag" to form a
// reference incorporating both the name and the tag.
// FIXME: expects *namedRef to expose the distreference.Named implementation. Should revert to distreference.Named.
func XWithTag(name *namedRef, tag string) (XNamedTagged, error) {
r, err := distreference.WithTag(name, tag)
if err != nil {
return nil, err
}
return &taggedRef{NamedTagged: r, namedRef: namedRef{r}}, nil
func XWithTag(name distreference.Named, tag string) (XNamedTagged, error) {
return distreference.WithTag(name, tag)
}
type namedRef struct {
distreference.Named // FIXME: must implement private distreference.NamedRepository
}
type taggedRef struct {
distreference.NamedTagged
namedRef
}
type canonicalRef struct {
namedRef
}