Kaynağa Gözat

pkg/archive: rename max/min as it collides with go1.21 builtin

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 55192de9e3d78245077d2a0c5480bedf0119208d)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 1 yıl önce
ebeveyn
işleme
b340a777c0
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      pkg/archive/changes_test.go

+ 3 - 3
pkg/archive/changes_test.go

@@ -21,7 +21,7 @@ import (
 	"gotest.tools/v3/skip"
 )
 
-func max(x, y int) int {
+func maxInt(x, y int) int {
 	if x >= y {
 		return x
 	}
@@ -404,7 +404,7 @@ func TestChangesDirsMutated(t *testing.T) {
 		{filepath.FromSlash("/symlinknew"), ChangeAdd},
 	}...)
 
-	for i := 0; i < max(len(changes), len(expectedChanges)); i++ {
+	for i := 0; i < maxInt(len(changes), len(expectedChanges)); i++ {
 		if i >= len(expectedChanges) {
 			t.Fatalf("unexpected change %s\n", changes[i].String())
 		}
@@ -530,7 +530,7 @@ func checkChanges(expectedChanges, changes []Change, t *testing.T) {
 	skip.If(t, runtime.GOOS != "windows" && os.Getuid() != 0, "skipping test that requires root")
 	sort.Sort(changesByPath(expectedChanges))
 	sort.Sort(changesByPath(changes))
-	for i := 0; i < max(len(changes), len(expectedChanges)); i++ {
+	for i := 0; i < maxInt(len(changes), len(expectedChanges)); i++ {
 		if i >= len(expectedChanges) {
 			t.Fatalf("unexpected change %s\n", changes[i].String())
 		}