diff --git a/go.mod b/go.mod index 18c9c6e..897fc9a 100644 --- a/go.mod +++ b/go.mod @@ -6,10 +6,11 @@ require ( github.com/aws/aws-sdk-go v1.29.18 github.com/fatih/color v1.9.0 github.com/keybase/go-keychain v0.0.0-20200218013740-86d4642e4ce2 + github.com/mattn/go-colorable v0.1.4 github.com/mitchellh/go-homedir v1.1.0 github.com/satori/go.uuid v1.2.0 - github.com/spf13/cobra v0.0.6 // indirect - github.com/spf13/viper v1.6.2 // indirect + github.com/spf13/cobra v0.0.6 + github.com/spf13/viper v1.6.2 github.com/subosito/gotenv v1.2.0 github.com/tidwall/gjson v1.6.0 github.com/tidwall/sjson v1.0.4 diff --git a/go.sum b/go.sum index 4ff473c..8677fad 100644 --- a/go.sum +++ b/go.sum @@ -58,8 +58,10 @@ github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvW github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= @@ -176,6 +178,7 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= diff --git a/v4/components/catalog/file.go b/v4/components/catalog/file.go index 258c442..2d1f8ff 100644 --- a/v4/components/catalog/file.go +++ b/v4/components/catalog/file.go @@ -2,6 +2,7 @@ package catalog import ( "errors" + "time" "github.com/turnerlabs/cstore/v4/components/local" @@ -13,7 +14,7 @@ const name = "state.yml" // RemoveRecords ... func (c Catalog) RemoveRecords(fileName string) error { - pulls := map[string]time.Time{} + pulls := map[string]State{} b, err := local.Get(name, "") if err == nil { @@ -34,6 +35,7 @@ func (c Catalog) RemoveRecords(fileName string) error { // RecordPull ... func (c Catalog) RecordPull(fileName string, lastPull time.Time, version string) error { + if lastPull.IsZero() { return errors.New("invalid time") }