Rearrange some code, adds pm av

This commit is contained in:
sm
2018-03-02 23:23:13 -08:00
parent 74d360f6d7
commit dd3fecc699
5 changed files with 83 additions and 16 deletions
+12
View File
@@ -9,8 +9,20 @@ import (
// Name exists to document the keys in Available
type Name string
type Names []Name
func (n Names) Len() int { return len(n) }
func (n Names) Swap(a, b int) { n[a], n[b] = n[b], n[a] }
func (n Names) Less(a, b int) bool { return n[a] < n[b] }
// Version exists to document the keys in Available
type Version string
type Versions []Version
// TODO (sm): make this semver sort?
func (n Versions) Len() int { return len(n) }
func (n Versions) Swap(a, b int) { n[a], n[b] = n[b], n[a] }
func (n Versions) Less(a, b int) bool { return n[a] < n[b] }
// Available is the structure used to represent the collection of all packages
// that can be installed.