Skip to content

Commit 75f91bd

Browse files
committed
TestConvertCPUSharesToCgroupV2Value: nits
Rename some variables, and simplify the error message using the got/want pattern. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent fd95216 commit 75f91bd

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
@@ -555,10 +555,10 @@ func TestConvertCPUSharesToCgroupV2Value(t *testing.T) {
555555
sharesMax: weightMax, // Maximum.
556556
sharesMax + 1: weightMax, // Above the maximum (out of range).
557557
}
558-
for i, expected := range cases {
559-
got := ConvertCPUSharesToCgroupV2Value(i)
560-
if got != expected {
561-
t.Errorf("expected ConvertCPUSharesToCgroupV2Value(%d) to be %d, got %d", i, expected, got)
558+
for shares, want := range cases {
559+
got := ConvertCPUSharesToCgroupV2Value(shares)
560+
if got != want {
561+
t.Errorf("ConvertCPUSharesToCgroupV2Value(%d): got %d, want %d", shares, got, want)
562562
}
563563
}
564564
}

0 commit comments

Comments
 (0)