diff --git a/CHANGELOG.md b/CHANGELOG.md index 943a6cd6c4..a0c9c65a79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ were being displayed rather than the check's current values. - Use the provided etcd client TLS information when the flag `--no-embed-etcd` is used. - Increase duration delta in TestPeriodicKeepalive integration test. +- Fixed some problems introduced by Go 1.11. ### Breaking Changes - Removed the KeepaliveTimeout attribute from entities. diff --git a/agent/token.go b/agent/token.go index 02d7ccbb5b..298e8c431c 100644 --- a/agent/token.go +++ b/agent/token.go @@ -79,6 +79,9 @@ func defaultFunc(v ...interface{}) interface{} { if len(v) == 1 { return v[0] } else if len(v) == 2 { + if v[1] == nil { + return v[0] + } return v[1] } return nil diff --git a/backend/monitor/supervisor.go b/backend/monitor/supervisor.go index b13224f437..ca16710759 100644 --- a/backend/monitor/supervisor.go +++ b/backend/monitor/supervisor.go @@ -106,7 +106,7 @@ func (m *EtcdSupervisor) Monitor(ctx context.Context, name string, event *types. } shutdownFunc := func() { - logger.Info("shutting down monitor for %s", key) + logger.Infof("shutting down monitor for %s", key) } // start the watcher @@ -172,7 +172,7 @@ func watchMon(ctx context.Context, cli *clientv3.Client, mon *monitor, failureHa ) if _, err := cli.Lease.Revoke(ctx, mon.leaseID); err != nil { - logger.WithError(err).Warningf("could not revoke the lease %s for the key %s", + logger.WithError(err).Warningf("could not revoke the lease %v for the key %s", mon.leaseID, mon.key, ) } diff --git a/backend/queue/queue_test.go b/backend/queue/queue_test.go index b316a9ab7d..e37769bc46 100644 --- a/backend/queue/queue_test.go +++ b/backend/queue/queue_test.go @@ -235,7 +235,6 @@ func TestDequeueParallel(t *testing.T) { // If we had multiple errors, only the last one is saved require.NoError(t, errEnqueue) results := make(map[string]struct{}) - var errDequeue error wg.Add(len(items)) for range items { go func() { @@ -245,7 +244,6 @@ func TestDequeueParallel(t *testing.T) { mu.Lock() defer mu.Unlock() if err != nil { - errDequeue = err return } results[item.Value()] = struct{}{}