diff --git a/daemon/health.go b/daemon/health.go index 6b8effb119866d9c833d9d2f2574fc400edf2acf..a069fcc8dc93df4e76e3501296492083eb36ef09 100644 --- a/daemon/health.go +++ b/daemon/health.go @@ -406,7 +406,7 @@ func (b *limitedBuffer) Write(data []byte) (int, error) { bufLen := b.buf.Len() dataLen := len(data) - keep := min(maxOutputLen-bufLen, dataLen) + keep := minInt(maxOutputLen-bufLen, dataLen) if keep > 0 { b.buf.Write(data[:keep]) } @@ -436,7 +436,7 @@ func timeoutWithDefault(configuredValue time.Duration, defaultValue time.Duratio return configuredValue } -func min(x, y int) int { +func minInt(x, y int) int { if x < y { return x } diff --git a/daemon/images/image_windows.go b/daemon/images/image_windows.go index d69674cbea281c3f173c071b237817377fef0e73..95a6ccb8a3afa73d7b38439f8ec4d9c1ecbea027 100644 --- a/daemon/images/image_windows.go +++ b/daemon/images/image_windows.go @@ -18,8 +18,8 @@ func (i *ImageService) GetContainerLayerSize(ctx context.Context, containerID st // GetLayerFolders returns the layer folders from an image RootFS func (i *ImageService) GetLayerFolders(img *image.Image, rwLayer layer.RWLayer) ([]string, error) { folders := []string{} - max := len(img.RootFS.DiffIDs) - for index := 1; index <= max; index++ { + rd := len(img.RootFS.DiffIDs) + for index := 1; index <= rd; index++ { // FIXME: why does this mutate the RootFS? img.RootFS.DiffIDs = img.RootFS.DiffIDs[:index] if !system.IsOSSupported(img.OperatingSystem()) {