Skip to content

Commit 23d76ee

Browse files
committed
TestConvertCPUSharesToCgroupV2Value: nits
Rename some variables, and simplify the error message using the got/want pattern. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
1 parent 7bd0aa5 commit 23d76ee

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,10 @@ func TestConvertCPUSharesToCgroupV2Value(t *testing.T) {
545545
262144: 10000, // Maximum.
546546
262145: 10000, // Above the maximum (out of range).
547547
}
548-
for i, expected := range cases {
549-
got := ConvertCPUSharesToCgroupV2Value(i)
550-
if got != expected {
551-
t.Errorf("expected ConvertCPUSharesToCgroupV2Value(%d) to be %d, got %d", i, expected, got)
548+
for shares, want := range cases {
549+
got := ConvertCPUSharesToCgroupV2Value(shares)
550+
if got != want {
551+
t.Errorf("ConvertCPUSharesToCgroupV2Value(%d): got %d, want %d", shares, got, want)
552552
}
553553
}
554554
}

0 commit comments

Comments
 (0)