Adding utility functions - IsNameOnly and WithDefaultTag
Signed-off-by: Nishant Totla <nishanttotla@gmail.com>
This commit is contained in:
parent
cb98aa744b
commit
2caeb6192a
2 changed files with 34 additions and 0 deletions
12
reference/helpers.go
Normal file
12
reference/helpers.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package reference
|
||||
|
||||
// IsNameOnly returns true if reference only contains a repo name.
|
||||
func IsNameOnly(ref Named) bool {
|
||||
if _, ok := ref.(NamedTagged); ok {
|
||||
return false
|
||||
}
|
||||
if _, ok := ref.(Canonical); ok {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue