Skip to content

Commit 55192de

Browse files
committed
pkg/archive: rename max/min as it collides with go1.21 builtin
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a386799 commit 55192de

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/archive/changes_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"gotest.tools/v3/skip"
2222
)
2323

24-
func max(x, y int) int {
24+
func maxInt(x, y int) int {
2525
if x >= y {
2626
return x
2727
}
@@ -404,7 +404,7 @@ func TestChangesDirsMutated(t *testing.T) {
404404
{filepath.FromSlash("/symlinknew"), ChangeAdd},
405405
}...)
406406

407-
for i := 0; i < max(len(changes), len(expectedChanges)); i++ {
407+
for i := 0; i < maxInt(len(changes), len(expectedChanges)); i++ {
408408
if i >= len(expectedChanges) {
409409
t.Fatalf("unexpected change %s\n", changes[i].String())
410410
}
@@ -530,7 +530,7 @@ func checkChanges(expectedChanges, changes []Change, t *testing.T) {
530530
skip.If(t, runtime.GOOS != "windows" && os.Getuid() != 0, "skipping test that requires root")
531531
sort.Sort(changesByPath(expectedChanges))
532532
sort.Sort(changesByPath(changes))
533-
for i := 0; i < max(len(changes), len(expectedChanges)); i++ {
533+
for i := 0; i < maxInt(len(changes), len(expectedChanges)); i++ {
534534
if i >= len(expectedChanges) {
535535
t.Fatalf("unexpected change %s\n", changes[i].String())
536536
}

0 commit comments

Comments
 (0)