Skip to content

Commit

Permalink
Don't unnecessarily use named returns
Browse files Browse the repository at this point in the history
They get horribly confusing, especially here where we use "rc"
for two completely different purposes:
containers/podman#22575 (comment)

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed May 9, 2024
1 parent 9318d0e commit 2473e92
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions storage/storage_src.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ func (s *storageImageSource) Close() error {
// GetBlob returns a stream for the specified blob, and the blob’s size (or -1 if unknown).
// The Digest field in BlobInfo is guaranteed to be provided, Size may be -1 and MediaType may be optionally provided.
// May update BlobInfoCache, preferably after it knows for certain that a blob truly exists at a specific location.
func (s *storageImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (rc io.ReadCloser, n int64, err error) {
func (s *storageImageSource) GetBlob(ctx context.Context, info types.BlobInfo, cache types.BlobInfoCache) (io.ReadCloser, int64, error) {
// We need a valid digest value.
digest := info.Digest

err = digest.Validate()
if err != nil {
if err := digest.Validate(); err != nil {
return nil, 0, err
}

Expand Down Expand Up @@ -154,7 +153,7 @@ func (s *storageImageSource) GetBlob(ctx context.Context, info types.BlobInfo, c
// NOTE: the blob is first written to a temporary file and subsequently
// closed. The intention is to keep the time we own the storage lock
// as short as possible to allow other processes to access the storage.
rc, n, _, err = s.getBlobAndLayerID(digest, layers)
rc, n, _, err := s.getBlobAndLayerID(digest, layers)
if err != nil {
return nil, 0, err
}
Expand Down

0 comments on commit 2473e92

Please sign in to comment.