Add HumanReadableString() to Package

This commit is contained in:
Ettore Di Giacinto
2020-02-18 18:20:45 +01:00
parent 189c042fea
commit b01c017507

View File

@@ -87,6 +87,7 @@ type Package interface {
SelectorMatchVersion(string) (bool, error)
String() string
HumanReadableString() string
}
type Tree interface {
@@ -173,6 +174,10 @@ func (p *DefaultPackage) GetFingerPrint() string {
return fmt.Sprintf("%s-%s-%s", p.Name, p.Category, p.Version)
}
func (p *DefaultPackage) HumanReadableString() string {
return fmt.Sprintf("%s/%s-%s", p.Category, p.Name, p.Version)
}
func FromString(s string) Package {
var unescaped DefaultPackage