distribution: remove use of deprecated os.SEEK_END

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2019-11-25 18:51:57 +01:00
parent 8840071c26
commit 0cc7ad0a7d
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -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