diff --git a/pkg/kubelet/dockertools/fake_docker_client.go b/pkg/kubelet/dockertools/fake_docker_client.go index ea6df4b156065..e2e993512046c 100644 --- a/pkg/kubelet/dockertools/fake_docker_client.go +++ b/pkg/kubelet/dockertools/fake_docker_client.go @@ -71,7 +71,8 @@ func (f *FakeDockerClient) AssertUnorderedCalls(calls []string) (err error) { f.Lock() defer f.Unlock() - var actual, expected []string + actual := make([]string, len(calls)) + expected := make([]string, len(f.called)) copy(actual, calls) copy(expected, f.called) diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index 4b43df8bee49b..4a71542a01e2b 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -144,7 +144,8 @@ func verifyStringArrayEquals(t *testing.T, actual, expected []string) { } func verifyStringArrayEqualsAnyOrder(t *testing.T, actual, expected []string) { - var act, exp []string + act := make([]string, len(actual)) + exp := make([]string, len(expected)) copy(act, actual) copy(exp, expected)