From fc518b86c579ca536290ed4f37436198e96d191f Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Sun, 5 Feb 2017 16:38:40 -0500 Subject: [PATCH] *: golint and change import paths Signed-off-by: Vincent Batts --- cmd/sl-feeds/main.go | 7 +++++-- fetch/fetch.go | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cmd/sl-feeds/main.go b/cmd/sl-feeds/main.go index e61fe4a..a75216a 100644 --- a/cmd/sl-feeds/main.go +++ b/cmd/sl-feeds/main.go @@ -8,10 +8,10 @@ import ( "path/filepath" "time" - "../../changelog" - "../../fetch" "github.com/BurntSushi/toml" "github.com/urfave/cli" + "github.com/vbatts/sl-feeds/changelog" + "github.com/vbatts/sl-feeds/fetch" ) func main() { @@ -164,11 +164,14 @@ func main() { app.Run(os.Args) } +// Config is read in to point to where RSS are written to, and the Mirrors to +// be fetched from type Config struct { Dest string Mirrors []Mirror } +// Mirror is where the release/ChangeLog.txt will be fetched from type Mirror struct { URL string Releases []string diff --git a/fetch/fetch.go b/fetch/fetch.go index 4bc2242..1170eed 100644 --- a/fetch/fetch.go +++ b/fetch/fetch.go @@ -5,7 +5,7 @@ import ( "net/http" "time" - "../changelog" + "github.com/vbatts/sl-feeds/changelog" ) // Repo represents a remote slackware software repo @@ -42,11 +42,11 @@ func (r Repo) NewerChangeLog(than time.Time) (e []changelog.Entry, mtime time.Ti if mtime.After(than) { return r.ChangeLog() } - return nil, time.Unix(0, 0), NotNewer + return nil, time.Unix(0, 0), ErrNotNewer } -// NotNewer is a status error usage to indicate that the remote file is not newer -var NotNewer = fmt.Errorf("Remote file is not newer than provided time") +// ErrNotNewer is a status error usage to indicate that the remote file is not newer +var ErrNotNewer = fmt.Errorf("Remote file is not newer than provided time") // ChangeLog fetches the ChangeLog.txt for this remote Repo, along with the // last-modified (for comparisons).