Skip to content

Commit a386799

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

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

daemon/health.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func (b *limitedBuffer) Write(data []byte) (int, error) {
406406

407407
bufLen := b.buf.Len()
408408
dataLen := len(data)
409-
keep := min(maxOutputLen-bufLen, dataLen)
409+
keep := minInt(maxOutputLen-bufLen, dataLen)
410410
if keep > 0 {
411411
b.buf.Write(data[:keep])
412412
}
@@ -436,7 +436,7 @@ func timeoutWithDefault(configuredValue time.Duration, defaultValue time.Duratio
436436
return configuredValue
437437
}
438438

439-
func min(x, y int) int {
439+
func minInt(x, y int) int {
440440
if x < y {
441441
return x
442442
}

daemon/images/image_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ func (i *ImageService) GetContainerLayerSize(ctx context.Context, containerID st
1818
// GetLayerFolders returns the layer folders from an image RootFS
1919
func (i *ImageService) GetLayerFolders(img *image.Image, rwLayer layer.RWLayer) ([]string, error) {
2020
folders := []string{}
21-
max := len(img.RootFS.DiffIDs)
22-
for index := 1; index <= max; index++ {
21+
rd := len(img.RootFS.DiffIDs)
22+
for index := 1; index <= rd; index++ {
2323
// FIXME: why does this mutate the RootFS?
2424
img.RootFS.DiffIDs = img.RootFS.DiffIDs[:index]
2525
if !system.IsOSSupported(img.OperatingSystem()) {

0 commit comments

Comments
 (0)