From 7571820812285f3960b1e05106cdd3830423f5d1 Mon Sep 17 00:00:00 2001 From: Oliver Tonnhofer Date: Fri, 26 Oct 2018 13:20:38 +0200 Subject: [PATCH] lint: reduce go vet/golint warnings --- cmd/imposm/main.go | 12 ++-- config/config.go | 10 ++-- database/postgis/spec.go | 2 +- expire/tilelist.go | 4 +- expire/tilelist_test.go | 2 +- import_/import.go | 2 +- mapping/columns.go | 2 +- mapping/config/config.go | 4 +- stats/http.go | 2 +- stats/memprof.go | 2 +- test/expire_tiles_test.go | 2 +- test/helper_test.go | 122 +++++++++++++++++++------------------- update/run.go | 22 +++---- 13 files changed, 95 insertions(+), 93 deletions(-) diff --git a/cmd/imposm/main.go b/cmd/imposm/main.go index 44f25722..2837ae70 100644 --- a/cmd/imposm/main.go +++ b/cmd/imposm/main.go @@ -42,22 +42,22 @@ func Main(usage func()) { switch os.Args[1] { case "import": opts := config.ParseImport(os.Args[2:]) - if opts.Base.Httpprofile != "" { - stats.StartHttpPProf(opts.Base.Httpprofile) + if opts.Base.HTTPProfile != "" { + stats.StartHTTPPProf(opts.Base.HTTPProfile) } import_.Import(opts) case "diff": opts, files := config.ParseDiffImport(os.Args[2:]) - if opts.Httpprofile != "" { - stats.StartHttpPProf(opts.Httpprofile) + if opts.HTTPProfile != "" { + stats.StartHTTPPProf(opts.HTTPProfile) } update.Diff(opts, files) case "run": opts := config.ParseRunImport(os.Args[2:]) - if opts.Httpprofile != "" { - stats.StartHttpPProf(opts.Httpprofile) + if opts.HTTPProfile != "" { + stats.StartHTTPPProf(opts.HTTPProfile) } update.Run(opts) case "query-cache": diff --git a/config/config.go b/config/config.go index 2e771089..35f570e9 100644 --- a/config/config.go +++ b/config/config.go @@ -22,7 +22,7 @@ type Config struct { Schemas Schemas `json:"schemas"` ExpireTilesDir string `json:"expiretiles_dir"` ExpireTilesZoom int `json:"expiretiles_zoom"` - ReplicationUrl string `json:"replication_url"` + ReplicationURL string `json:"replication_url"` ReplicationInterval MinutesInterval `json:"replication_interval"` DiffStateBefore MinutesInterval `json:"diff_state_before"` } @@ -48,12 +48,12 @@ type Base struct { LimitTo string LimitToCacheBuffer float64 ConfigFile string - Httpprofile string + HTTPProfile string Quiet bool Schemas Schemas ExpireTilesDir string ExpireTilesZoom int - ReplicationUrl string + ReplicationURL string ReplicationInterval time.Duration DiffStateBefore time.Duration } @@ -129,7 +129,7 @@ func (o *Base) updateFromConfig() error { if o.ReplicationInterval < time.Minute { o.ReplicationInterval = time.Minute } - o.ReplicationUrl = conf.ReplicationUrl + o.ReplicationURL = conf.ReplicationURL if o.DiffDir == "" { if conf.DiffDir == "" { @@ -179,7 +179,7 @@ func addBaseFlags(opts *Base, flags *flag.FlagSet) { flags.StringVar(&opts.LimitTo, "limitto", "", "limit to geometries") flags.Float64Var(&opts.LimitToCacheBuffer, "limittocachebuffer", 0.0, "limit to buffer for cache") flags.StringVar(&opts.ConfigFile, "config", "", "config (json)") - flags.StringVar(&opts.Httpprofile, "httpprofile", "", "bind address for profile server") + flags.StringVar(&opts.HTTPProfile, "httpprofile", "", "bind address for profile server") flags.BoolVar(&opts.Quiet, "quiet", false, "quiet log output") flags.StringVar(&opts.Schemas.Import, "dbschema-import", defaultSchemaImport, "db schema for imports") flags.StringVar(&opts.Schemas.Production, "dbschema-production", defaultSchemaProduction, "db schema for production") diff --git a/database/postgis/spec.go b/database/postgis/spec.go index 53d6c61a..8eadc0e2 100644 --- a/database/postgis/spec.go +++ b/database/postgis/spec.go @@ -162,7 +162,7 @@ func NewGeneralizedTableSpec(pg *PostGIS, t *config.GeneralizedTable) *Generaliz FullName: pg.Prefix + t.Name, Schema: pg.Config.ImportSchema, Tolerance: t.Tolerance, - Where: t.SqlFilter, + Where: t.SQLFilter, SourceName: t.SourceTableName, } return &spec diff --git a/expire/tilelist.go b/expire/tilelist.go index 6bcac4b2..8e0d145a 100644 --- a/expire/tilelist.go +++ b/expire/tilelist.go @@ -25,7 +25,7 @@ var mercRes [20]float64 func init() { res := 2 * 20037508.342789244 / 256 - for i, _ := range mercRes { + for i := range mercRes { mercRes[i] = res res /= 2 } @@ -135,7 +135,7 @@ func (tl *TileList) expireBox(b bbox) { } func (tl *TileList) writeTiles(w io.Writer) error { - for tileKey, _ := range tl.tiles { + for tileKey := range tl.tiles { _, err := fmt.Fprintf(w, "%d/%d/%d\n", tl.zoom, tileKey.X, tileKey.Y) if err != nil { return err diff --git a/expire/tilelist_test.go b/expire/tilelist_test.go index f95dbb9c..4bcb9319 100644 --- a/expire/tilelist_test.go +++ b/expire/tilelist_test.go @@ -75,7 +75,7 @@ func TestTileList_ExpireNodes(t *testing.T) { tl.ExpireNodes(test.nodes, test.polygon) if len(tl.tiles) != test.expected { t.Errorf("expected %d tiles, got %d", test.expected, len(tl.tiles)) - for tk, _ := range tl.tiles { + for tk := range tl.tiles { t.Errorf("\t%v", tk) } } diff --git a/import_/import.go b/import_/import.go index 79355f40..32051256 100644 --- a/import_/import.go +++ b/import_/import.go @@ -129,7 +129,7 @@ func Import(importOpts config.Import) { osmCache.Close() step() if importOpts.Diff { - diffstate, err := estimateFromPBF(importOpts.Read, baseOpts.DiffStateBefore, baseOpts.ReplicationUrl, baseOpts.ReplicationInterval) + diffstate, err := estimateFromPBF(importOpts.Read, baseOpts.DiffStateBefore, baseOpts.ReplicationURL, baseOpts.ReplicationInterval) if err != nil { log.Println("[error] parsing diff state form PBF", err) } else if diffstate != nil { diff --git a/mapping/columns.go b/mapping/columns.go index 18838df1..233d8401 100644 --- a/mapping/columns.go +++ b/mapping/columns.go @@ -395,7 +395,7 @@ func MakeSuffixReplace(columnName string, columnType ColumnType, column config.C strChanges[k.(string)] = v.(string) } var suffixes []string - for k, _ := range strChanges { + for k := range strChanges { suffixes = append(suffixes, k) } reStr := `(` + strings.Join(suffixes, "|") + `)\b` diff --git a/mapping/config/config.go b/mapping/config/config.go index 08a94a56..b565e555 100644 --- a/mapping/config/config.go +++ b/mapping/config/config.go @@ -43,7 +43,7 @@ type GeneralizedTable struct { Name string SourceTableName string `yaml:"source"` Tolerance float64 `yaml:"tolerance"` - SqlFilter string `yaml:"sql_filter"` + SQLFilter string `yaml:"sql_filter"` } type Filters struct { @@ -101,7 +101,7 @@ func (kv *KeyValues) UnmarshalYAML(unmarshal func(interface{}) error) error { } else { return fmt.Errorf("mapping value '%s' not a string", v) } - order += 1 + order++ } } return nil diff --git a/stats/http.go b/stats/http.go index c0dcb73b..340e91f3 100644 --- a/stats/http.go +++ b/stats/http.go @@ -7,7 +7,7 @@ import ( "github.com/omniscale/imposm3/log" ) -func StartHttpPProf(bind string) { +func StartHTTPPProf(bind string) { go func() { log.Println(http.ListenAndServe(bind, nil)) }() diff --git a/stats/memprof.go b/stats/memprof.go index 8d73e911..6352f8de 100644 --- a/stats/memprof.go +++ b/stats/memprof.go @@ -17,7 +17,7 @@ func MemProfiler(dir string, interval time.Duration) { ticker := time.NewTicker(interval) i := 0 - for _ = range ticker.C { + for range ticker.C { filename := path.Join( dir, fmt.Sprintf("memprof-%03d.pprof", i), diff --git a/test/expire_tiles_test.go b/test/expire_tiles_test.go index 1f539aeb..413fe3c6 100644 --- a/test/expire_tiles_test.go +++ b/test/expire_tiles_test.go @@ -176,7 +176,7 @@ func TestExpireTiles(t *testing.T) { if len(tiles) > 0 { t.Errorf("found %d unexpected tiles", len(tiles)) } - for tile, _ := range tiles { + for tile := range tiles { t.Errorf("unexpected tile expired: %v", tile) } }) diff --git a/test/helper_test.go b/test/helper_test.go index fcacb90a..b62d872d 100644 --- a/test/helper_test.go +++ b/test/helper_test.go @@ -37,21 +37,23 @@ type importTestSuite struct { const Missing = "" -func (s *importTestSuite) dbschemaImport() string { return "imposm_test_" + s.name + "_import" } -func (s *importTestSuite) dbschemaProduction() string { return "imposm_test_" + s.name + "_production" } -func (s *importTestSuite) dbschemaBackup() string { return "imposm_test_" + s.name + "_backup" } +func (ts *importTestSuite) dbschemaImport() string { return "imposm_test_" + ts.name + "_import" } +func (ts *importTestSuite) dbschemaProduction() string { + return "imposm_test_" + ts.name + "_production" +} +func (ts *importTestSuite) dbschemaBackup() string { return "imposm_test_" + ts.name + "_backup" } -func (s *importTestSuite) importOsm(t *testing.T) { +func (ts *importTestSuite) importOsm(t *testing.T) { importArgs := []string{ - "-connection", s.config.connection, - "-read", s.config.osmFileName, + "-connection", ts.config.connection, + "-read", ts.config.osmFileName, "-write", - "-cachedir", s.config.cacheDir, + "-cachedir", ts.config.cacheDir, "-diff", "-overwritecache", - "-dbschema-import", s.dbschemaImport(), + "-dbschema-import", ts.dbschemaImport(), // "-optimize", - "-mapping", s.config.mappingFileName, + "-mapping", ts.config.mappingFileName, "-quiet", "-revertdeploy=false", "-deployproduction=false", @@ -62,7 +64,7 @@ func (s *importTestSuite) importOsm(t *testing.T) { import_.Import(opts) } -func (s *importTestSuite) deployOsm(t *testing.T) { +func (ts *importTestSuite) deployOsm(t *testing.T) { importArgs := []string{ "-read=", // overwrite previous options "-write=false", @@ -70,12 +72,12 @@ func (s *importTestSuite) deployOsm(t *testing.T) { "-revertdeploy=false", "-deployproduction", "-removebackup=false", - "-connection", s.config.connection, - "-dbschema-import", s.dbschemaImport(), - "-dbschema-production", s.dbschemaProduction(), - "-dbschema-backup", s.dbschemaBackup(), + "-connection", ts.config.connection, + "-dbschema-import", ts.dbschemaImport(), + "-dbschema-production", ts.dbschemaProduction(), + "-dbschema-backup", ts.dbschemaBackup(), "-deployproduction", - "-mapping", s.config.mappingFileName, + "-mapping", ts.config.mappingFileName, "-quiet", } @@ -83,7 +85,7 @@ func (s *importTestSuite) deployOsm(t *testing.T) { import_.Import(opts) } -func (s *importTestSuite) revertDeployOsm(t *testing.T) { +func (ts *importTestSuite) revertDeployOsm(t *testing.T) { importArgs := []string{ "-read=", // overwrite previous options "-write=false", @@ -91,14 +93,14 @@ func (s *importTestSuite) revertDeployOsm(t *testing.T) { "-revertdeploy", "-deployproduction=false", "-removebackup=false", - "-connection", s.config.connection, - "-dbschema-import", s.dbschemaImport(), - "-dbschema-production", s.dbschemaProduction(), - "-dbschema-backup", s.dbschemaBackup(), + "-connection", ts.config.connection, + "-dbschema-import", ts.dbschemaImport(), + "-dbschema-production", ts.dbschemaProduction(), + "-dbschema-backup", ts.dbschemaBackup(), "-revertdeploy", "-deployproduction=false", "-removebackup=false", - "-mapping", s.config.mappingFileName, + "-mapping", ts.config.mappingFileName, "-quiet", } @@ -106,23 +108,23 @@ func (s *importTestSuite) revertDeployOsm(t *testing.T) { import_.Import(opts) } -func (s *importTestSuite) cache(t *testing.T) *cache.OSMCache { - c := cache.NewOSMCache(s.config.cacheDir) +func (ts *importTestSuite) cache(t *testing.T) *cache.OSMCache { + c := cache.NewOSMCache(ts.config.cacheDir) if err := c.Open(); err != nil { t.Fatal(err) } return c } -func (s *importTestSuite) diffCache(t *testing.T) *cache.DiffCache { - c := cache.NewDiffCache(s.config.cacheDir) +func (ts *importTestSuite) diffCache(t *testing.T) *cache.DiffCache { + c := cache.NewDiffCache(ts.config.cacheDir) if err := c.Open(); err != nil { t.Fatal(err) } return c } -func (s *importTestSuite) removeBackupOsm(t *testing.T) { +func (ts *importTestSuite) removeBackupOsm(t *testing.T) { importArgs := []string{ "-read=", // overwrite previous options "-write=false", @@ -130,11 +132,11 @@ func (s *importTestSuite) removeBackupOsm(t *testing.T) { "-revertdeploy=false", "-deployproduction=false", "-removebackup", - "-connection", s.config.connection, - "-dbschema-import", s.dbschemaImport(), - "-dbschema-production", s.dbschemaProduction(), - "-dbschema-backup", s.dbschemaBackup(), - "-mapping", s.config.mappingFileName, + "-connection", ts.config.connection, + "-dbschema-import", ts.dbschemaImport(), + "-dbschema-production", ts.dbschemaProduction(), + "-dbschema-backup", ts.dbschemaBackup(), + "-mapping", ts.config.mappingFileName, "-quiet", } @@ -142,40 +144,40 @@ func (s *importTestSuite) removeBackupOsm(t *testing.T) { import_.Import(opts) } -func (s *importTestSuite) updateOsm(t *testing.T, diffFile string) { +func (ts *importTestSuite) updateOsm(t *testing.T, diffFile string) { args := []string{ - "-connection", s.config.connection, - "-cachedir", s.config.cacheDir, + "-connection", ts.config.connection, + "-cachedir", ts.config.cacheDir, "-limitto", "clipping.geojson", - "-dbschema-production", s.dbschemaProduction(), - "-mapping", s.config.mappingFileName, + "-dbschema-production", ts.dbschemaProduction(), + "-mapping", ts.config.mappingFileName, } - if s.config.expireTileDir != "" { - args = append(args, "-expiretiles-dir", s.config.expireTileDir) + if ts.config.expireTileDir != "" { + args = append(args, "-expiretiles-dir", ts.config.expireTileDir) } args = append(args, diffFile) opts, files := config.ParseDiffImport(args) update.Diff(opts, files) } -func (s *importTestSuite) dropSchemas() { +func (ts *importTestSuite) dropSchemas() { var err error - _, err = s.db.Exec(fmt.Sprintf(`DROP SCHEMA IF EXISTS %s CASCADE`, s.dbschemaImport())) + _, err = ts.db.Exec(fmt.Sprintf(`DROP SCHEMA IF EXISTS %s CASCADE`, ts.dbschemaImport())) if err != nil { log.Fatal(err) } - _, err = s.db.Exec(fmt.Sprintf(`DROP SCHEMA IF EXISTS %s CASCADE`, s.dbschemaProduction())) + _, err = ts.db.Exec(fmt.Sprintf(`DROP SCHEMA IF EXISTS %s CASCADE`, ts.dbschemaProduction())) if err != nil { log.Fatal(err) } - _, err = s.db.Exec(fmt.Sprintf(`DROP SCHEMA IF EXISTS %s CASCADE`, s.dbschemaBackup())) + _, err = ts.db.Exec(fmt.Sprintf(`DROP SCHEMA IF EXISTS %s CASCADE`, ts.dbschemaBackup())) if err != nil { log.Fatal(err) } } -func (s *importTestSuite) tableExists(t *testing.T, schema, table string) bool { - row := s.db.QueryRow(fmt.Sprintf(`SELECT EXISTS(SELECT * FROM information_schema.tables WHERE table_name='%s' AND table_schema='%s')`, table, schema)) +func (ts *importTestSuite) tableExists(t *testing.T, schema, table string) bool { + row := ts.db.QueryRow(fmt.Sprintf(`SELECT EXISTS(SELECT * FROM information_schema.tables WHERE table_name='%s' AND table_schema='%s')`, table, schema)) var exists bool if err := row.Scan(&exists); err != nil { t.Error(err) @@ -193,7 +195,7 @@ type record struct { tags map[string]string } -func (s *importTestSuite) query(t *testing.T, table string, id int64, keys []string) record { +func (ts *importTestSuite) query(t *testing.T, table string, id int64, keys []string) record { kv := make([]string, len(keys)) for i, k := range keys { kv[i] = "'" + k + "', " + k + "::varchar" @@ -204,8 +206,8 @@ func (s *importTestSuite) query(t *testing.T, table string, id int64, keys []str } else { columns = "hstore(ARRAY[" + columns + "])" } - stmt := fmt.Sprintf(`SELECT osm_id, name, type, ST_AsText(geometry), %s FROM "%s"."%s" WHERE osm_id=$1`, columns, s.dbschemaProduction(), table) - row := s.db.QueryRow(stmt, id) + stmt := fmt.Sprintf(`SELECT osm_id, name, type, ST_AsText(geometry), %s FROM "%s"."%s" WHERE osm_id=$1`, columns, ts.dbschemaProduction(), table) + row := ts.db.QueryRow(stmt, id) r := record{} h := hstore.Hstore{} if err := row.Scan(&r.id, &r.name, &r.osmType, &r.wkt, &h); err != nil { @@ -226,9 +228,9 @@ func (s *importTestSuite) query(t *testing.T, table string, id int64, keys []str return r } -func (s *importTestSuite) queryTags(t *testing.T, table string, id int64) record { - stmt := fmt.Sprintf(`SELECT osm_id, tags FROM "%s"."%s" WHERE osm_id=$1`, s.dbschemaProduction(), table) - row := s.db.QueryRow(stmt, id) +func (ts *importTestSuite) queryTags(t *testing.T, table string, id int64) record { + stmt := fmt.Sprintf(`SELECT osm_id, tags FROM "%s"."%s" WHERE osm_id=$1`, ts.dbschemaProduction(), table) + row := ts.db.QueryRow(stmt, id) r := record{} h := hstore.Hstore{} if err := row.Scan(&r.id, &h); err != nil { @@ -249,8 +251,8 @@ func (s *importTestSuite) queryTags(t *testing.T, table string, id int64) record return r } -func (s *importTestSuite) queryRows(t *testing.T, table string, id int64) []record { - rows, err := s.db.Query(fmt.Sprintf(`SELECT osm_id, name, type, ST_AsText(geometry) FROM "%s"."%s" WHERE osm_id=$1 ORDER BY type, name, ST_GeometryType(geometry)`, s.dbschemaProduction(), table), id) +func (ts *importTestSuite) queryRows(t *testing.T, table string, id int64) []record { + rows, err := ts.db.Query(fmt.Sprintf(`SELECT osm_id, name, type, ST_AsText(geometry) FROM "%s"."%s" WHERE osm_id=$1 ORDER BY type, name, ST_GeometryType(geometry)`, ts.dbschemaProduction(), table), id) if err != nil { t.Fatal(err) } @@ -265,8 +267,8 @@ func (s *importTestSuite) queryRows(t *testing.T, table string, id int64) []reco return rs } -func (s *importTestSuite) queryRowsTags(t *testing.T, table string, id int64) []record { - rows, err := s.db.Query(fmt.Sprintf(`SELECT osm_id, ST_AsText(geometry), tags FROM "%s"."%s" WHERE osm_id=$1 ORDER BY ST_GeometryType(geometry)`, s.dbschemaProduction(), table), id) +func (ts *importTestSuite) queryRowsTags(t *testing.T, table string, id int64) []record { + rows, err := ts.db.Query(fmt.Sprintf(`SELECT osm_id, ST_AsText(geometry), tags FROM "%s"."%s" WHERE osm_id=$1 ORDER BY ST_GeometryType(geometry)`, ts.dbschemaProduction(), table), id) if err != nil { t.Fatal(err) } @@ -290,9 +292,9 @@ func (s *importTestSuite) queryRowsTags(t *testing.T, table string, id int64) [] return rs } -func (s *importTestSuite) queryGeom(t *testing.T, table string, id int64) *geos.Geom { - stmt := fmt.Sprintf(`SELECT osm_id, ST_AsText(geometry) FROM "%s"."%s" WHERE osm_id=$1`, s.dbschemaProduction(), table) - row := s.db.QueryRow(stmt, id) +func (ts *importTestSuite) queryGeom(t *testing.T, table string, id int64) *geos.Geom { + stmt := fmt.Sprintf(`SELECT osm_id, ST_AsText(geometry) FROM "%s"."%s" WHERE osm_id=$1`, ts.dbschemaProduction(), table) + row := ts.db.QueryRow(stmt, id) r := record{} if err := row.Scan(&r.id, &r.wkt); err != nil { if err == sql.ErrNoRows { @@ -310,9 +312,9 @@ func (s *importTestSuite) queryGeom(t *testing.T, table string, id int64) *geos. return geom } -func (s *importTestSuite) queryDynamic(t *testing.T, table, where string) []map[string]string { - stmt := fmt.Sprintf(`SELECT hstore(r) FROM (SELECT ST_AsText(geometry) AS wkt, * FROM "%s"."%s" WHERE %s) AS r`, s.dbschemaProduction(), table, where) - rows, err := s.db.Query(stmt) +func (ts *importTestSuite) queryDynamic(t *testing.T, table, where string) []map[string]string { + stmt := fmt.Sprintf(`SELECT hstore(r) FROM (SELECT ST_AsText(geometry) AS wkt, * FROM "%s"."%s" WHERE %s) AS r`, ts.dbschemaProduction(), table, where) + rows, err := ts.db.Query(stmt) if err != nil { t.Fatal(err) } diff --git a/update/run.go b/update/run.go index 9d65dc29..96b7e419 100644 --- a/update/run.go +++ b/update/run.go @@ -41,19 +41,19 @@ func Run(baseOpts config.Base) { if err != nil { log.Fatal("[fatal] Unable to read last.state.txt:", err) } - replicationUrl := baseOpts.ReplicationUrl - if replicationUrl == "" { - replicationUrl = s.URL + replicationURL := baseOpts.ReplicationURL + if replicationURL == "" { + replicationURL = s.URL } - if replicationUrl == "" { - log.Fatal("[fatal] No replicationUrl in last.state.txt " + + if replicationURL == "" { + log.Fatal("[fatal] No replicationURL in last.state.txt " + "or replication_url in -config") } - log.Printf("[info] Starting replication from %s with %s interval", replicationUrl, baseOpts.ReplicationInterval) + log.Printf("[info] Starting replication from %s with %s interval", replicationURL, baseOpts.ReplicationInterval) downloader := diff.NewDownloader( baseOpts.DiffDir, - replicationUrl, + replicationURL, s.Sequence, baseOpts.ReplicationInterval, ) @@ -110,11 +110,11 @@ func Run(baseOpts config.Base) { continue } fname := seq.Filename - seqId := seq.Sequence + seqID := seq.Sequence seqTime := seq.Time for { - log.Printf("[info] Importing #%d including changes till %s (%s behind)", seqId, seqTime, time.Since(seqTime).Truncate(time.Second)) - finishedImport := log.Step(fmt.Sprintf("Importing #%d", seqId)) + log.Printf("[info] Importing #%d including changes till %s (%s behind)", seqID, seqTime, time.Since(seqTime).Truncate(time.Second)) + finishedImport := log.Step(fmt.Sprintf("Importing #%d", seqID)) err := Update(baseOpts, fname, geometryLimiter, tileExpireor, osmCache, diffCache, false) @@ -140,7 +140,7 @@ func Run(baseOpts config.Base) { } if err != nil { - log.Printf("[error] Importing #%d: %s", seqId, err) + log.Printf("[error] Importing #%d: %s", seqID, err) log.Println("[info] Retrying in", exp.Duration()) // TODO handle <-sigc during wait exp.Wait()