summaryrefslogtreecommitdiff
path: root/pkg/hooks/exec/exec_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 /pkg/hooks/exec/exec_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 'pkg/hooks/exec/exec_test.go')
-rw-r--r--pkg/hooks/exec/exec_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/hooks/exec/exec_test.go b/pkg/hooks/exec/exec_test.go
index 7aac315cb..1e105373d 100644
--- a/pkg/hooks/exec/exec_test.go
+++ b/pkg/hooks/exec/exec_test.go
@@ -94,7 +94,7 @@ func TestRunEnvironment(t *testing.T) {
Path: path,
Args: []string{"sh", "-c", "env"},
}
- for _, test := range []struct {
+ for _, tt := range []struct {
name string
env []string
expected map[string]string
@@ -120,6 +120,7 @@ func TestRunEnvironment(t *testing.T) {
},
},
} {
+ test := tt
t.Run(test.name, func(t *testing.T) {
var stderr, stdout bytes.Buffer
hook.Env = test.env
@@ -147,7 +148,7 @@ func TestRunCancel(t *testing.T) {
Args: []string{"sh", "-c", "echo waiting; sleep 2; echo done"},
}
one := 1
- for _, test := range []struct {
+ for _, tt := range []struct {
name string
contextTimeout time.Duration
hookTimeout *int
@@ -174,6 +175,7 @@ func TestRunCancel(t *testing.T) {
expectedRunError: context.DeadlineExceeded,
},
} {
+ test := tt
t.Run(test.name, func(t *testing.T) {
ctx := context.Background()
var stderr, stdout bytes.Buffer