Add structcheck, unused, and varcheck linters.

Warn on unused and dead code

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2017-11-13 16:21:26 -05:00
parent 96e2f30250
commit f74862a0dd
35 changed files with 29 additions and 444 deletions

View File

@@ -236,16 +236,6 @@ func (w *worker) getID() string {
return fmt.Sprintf("%d-%d", w.id, w.count)
}
func (w *worker) cleanup(ctx context.Context, c containerd.Container) {
if err := c.Delete(ctx, containerd.WithSnapshotCleanup); err != nil {
if err == context.DeadlineExceeded {
return
}
w.failures++
logrus.WithError(err).Errorf("delete container %s", c.ID())
}
}
// cleanup cleans up any containers in the "stress" namespace before the test run
func cleanup(ctx context.Context, client *containerd.Client) error {
containers, err := client.Containers(ctx)