From 52a4a7ed7b4183d850d6955b008c34cea5ffe997 Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Fri, 2 Mar 2018 23:23:21 -0800 Subject: [PATCH] go vet/golint --- available.go | 7 ++++++- cmd/pm/main.go | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/available.go b/available.go index 574760a..1e259f9 100644 --- a/available.go +++ b/available.go @@ -10,6 +10,7 @@ import ( // Name exists to document the keys in Available type Name string +// Names is a slice of names ... with sorting! type Names []Name func (n Names) Len() int { return len(n) } @@ -18,6 +19,8 @@ func (n Names) Less(a, b int) bool { return n[a] < n[b] } // Version exists to document the keys in Available type Version string + +// Versions is a slice of Version ... with sorting! type Versions []Version // TODO (sm): make this semver sort? @@ -54,9 +57,10 @@ func (a Available) Update(o Available) error { return nil } +// SetRemote adds the information in the url to the database. func (a Available) SetRemote(u url.URL) { for n, vers := range a { - for v, _ := range vers { + for v := range vers { m := a[n][v] m.Remote = u a[n][v] = m @@ -64,6 +68,7 @@ func (a Available) SetRemote(u url.URL) { } } +// Traverse returns a chan of Meta that will be sanely sorted. func (a Available) Traverse() <-chan Meta { r := make(chan Meta) go func() { diff --git a/cmd/pm/main.go b/cmd/pm/main.go index 99b27ab..6b292b1 100644 --- a/cmd/pm/main.go +++ b/cmd/pm/main.go @@ -13,6 +13,7 @@ import ( "mcquay.me/pm/pkg" ) +// Version stores the current version, and is updated at build time. const Version = "dev" const usage = `pm: simple, cross-platform system package manager