Ver Fonte

distribution: remove use of deprecated os.SEEK_END

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn há 5 anos atrás
pai
commit
0cc7ad0a7d
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      distribution/pull_v2.go

+ 2 - 2
distribution/pull_v2.go

@@ -174,7 +174,7 @@ func (ld *v2LayerDescriptor) Download(ctx context.Context, progressOutput progre
 			return nil, 0, xfer.DoNotRetry{Err: err}
 		}
 	} else {
-		offset, err = ld.tmpFile.Seek(0, os.SEEK_END)
+		offset, err = ld.tmpFile.Seek(0, io.SeekEnd)
 		if err != nil {
 			logrus.Debugf("error seeking to end of download file: %v", err)
 			offset = 0
@@ -209,7 +209,7 @@ func (ld *v2LayerDescriptor) Download(ctx context.Context, progressOutput progre
 			return nil, 0, err
 		}
 	}
-	size, err := layerDownload.Seek(0, os.SEEK_END)
+	size, err := layerDownload.Seek(0, io.SeekEnd)
 	if err != nil {
 		// Seek failed, perhaps because there was no Content-Length
 		// header. This shouldn't fail the download, because we can