Strings() for PackageList: turning list into sequence of package Ids. #116

This commit is contained in:
Andrey Smirnov
2014-11-14 00:19:58 +03:00
parent 61e22743af
commit 7beb90d4fc
+13
View File
@@ -205,6 +205,19 @@ func (l *PackageList) Architectures(includeSource bool) (result []string) {
return
}
// Strings builds list of strings with package keys
func (l *PackageList) Strings() []string {
result := make([]string, l.Len())
i := 0
for _, p := range l.packages {
result[i] = string(p.Key(""))
i += 1
}
return result
}
// depSliceDeduplicate removes dups in slice of Dependencies
func depSliceDeduplicate(s []Dependency) []Dependency {
l := len(s)