mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-27 12:31:23 +00:00
kubelet_test: Fix copy bug.
Initialize the slice before copying in verifyUnorderedCalls() and verifyStringArrayEqualsAnyOrder().
This commit is contained in:
parent
acd67ebea0
commit
7b1ea6b41d
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user