summaryrefslogtreecommitdiff
path: root/libpod/image/image_test.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-01-14 15:47:23 +0100
committerGitHub <noreply@github.com>2020-01-14 15:47:23 +0100
commit564bd693cae4e8a870be7a7860ef673e793f6358 (patch)
treeab395cdeab8814c2d3b426cf5215246057ff87ba /libpod/image/image_test.go
parent3961882ffe9e1cb83adab483caf39a0db5b4430a (diff)
parent460887edca95605ee203893448d98986a2521e2d (diff)
downloadpodman-564bd693cae4e8a870be7a7860ef673e793f6358.tar.gz
podman-564bd693cae4e8a870be7a7860ef673e793f6358.tar.bz2
podman-564bd693cae4e8a870be7a7860ef673e793f6358.zip
Merge pull request #4858 from vrothberg/enable-linters
make lint: extend checks
Diffstat (limited to 'libpod/image/image_test.go')
-rw-r--r--libpod/image/image_test.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/libpod/image/image_test.go b/libpod/image/image_test.go
index 5aff7d860..3ff6210d9 100644
--- a/libpod/image/image_test.go
+++ b/libpod/image/image_test.go
@@ -3,7 +3,6 @@ package image
import (
"context"
"fmt"
- "io"
"io/ioutil"
"os"
"testing"
@@ -91,8 +90,7 @@ func TestImage_NewFromLocal(t *testing.T) {
RunRoot: workdir,
GraphRoot: workdir,
}
- var writer io.Writer
- writer = os.Stdout
+ writer := os.Stdout
// Need images to be present for this test
ir, err := NewImageRuntimeFromOptions(so)
@@ -108,7 +106,7 @@ func TestImage_NewFromLocal(t *testing.T) {
for _, image := range tm {
// tag our images
- image.img.TagImage(image.taggedName)
+ err = image.img.TagImage(image.taggedName)
assert.NoError(t, err)
for _, name := range image.names {
newImage, err := ir.NewFromLocal(name)
@@ -142,8 +140,7 @@ func TestImage_New(t *testing.T) {
// Build the list of pull names
names = append(names, bbNames...)
names = append(names, fedoraNames...)
- var writer io.Writer
- writer = os.Stdout
+ writer := os.Stdout
// Iterate over the names and delete the image
// after the pull
@@ -213,7 +210,7 @@ func TestImage_RepoDigests(t *testing.T) {
t.Fatal(err)
}
- for _, test := range []struct {
+ for _, tt := range []struct {
name string
names []string
expected []string
@@ -234,6 +231,7 @@ func TestImage_RepoDigests(t *testing.T) {
expected: []string{"docker.io/library/busybox@sha256:7173b809ca12ec5dee4506cd86be934c4596dd234ee82c0662eac04a8c2c71dc"},
},
} {
+ test := tt
t.Run(test.name, func(t *testing.T) {
image := &Image{
image: &storage.Image{