From 270537596da6d0eca1fbee66760cacedf4f294a5 Mon Sep 17 00:00:00 2001 From: Xiaoxuan Wang Date: Mon, 16 Oct 2023 06:46:25 +0000 Subject: [PATCH] minor refinement Signed-off-by: Xiaoxuan Wang --- content/oci/deletableoci.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/content/oci/deletableoci.go b/content/oci/deletableoci.go index e0f99b64a..34616afbf 100644 --- a/content/oci/deletableoci.go +++ b/content/oci/deletableoci.go @@ -73,7 +73,7 @@ func NewDeletableStoreWithContext(ctx context.Context, root string) (*DeletableS if err != nil { return nil, fmt.Errorf("failed to create storage: %w", err) } - store := &DeletableStore{ + ds := &DeletableStore{ AutoSaveIndex: true, root: rootAbs, indexPath: filepath.Join(rootAbs, ocispec.ImageIndexFile), @@ -84,13 +84,13 @@ func NewDeletableStoreWithContext(ctx context.Context, root string) (*DeletableS if err := ensureDir(filepath.Join(rootAbs, ocispec.ImageBlobsDir)); err != nil { return nil, err } - if err := store.ensureOCILayoutFile(); err != nil { + if err := ds.ensureOCILayoutFile(); err != nil { return nil, fmt.Errorf("invalid OCI Image Layout: %w", err) } - if err := store.loadIndexFile(ctx); err != nil { + if err := ds.loadIndexFile(ctx); err != nil { return nil, fmt.Errorf("invalid OCI Image Index: %w", err) } - return store, nil + return ds, nil } // Fetch fetches the content identified by the descriptor.