Skip to content

Commit fad8ed4

Browse files
resolve comment
Signed-off-by: Xiaoxuan Wang <[email protected]>
1 parent 410068d commit fad8ed4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

content/oci/oci.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ import (
4444
type Store struct {
4545
// AutoSaveIndex controls if the OCI store will automatically save the index
4646
// file when needed.
47-
// - If AutoSaveIndex is set to true, the OCI store will automatically save the
48-
// changes to `index.json` on Tag() and Delete() calls, and when pushing a manifest.
47+
// - If AutoSaveIndex is set to true, the OCI store will automatically save
48+
// the changes to `index.json` when
49+
// 1. pushing a manifest
50+
// 2. calling Tag() or Delete()
4951
// - If AutoSaveIndex is set to false, it's the caller's responsibility
5052
// to manually call SaveIndex() when needed.
5153
// - Default value: true.
@@ -61,7 +63,7 @@ type Store struct {
6163
// has the exclusive access to Store if a delete operation is underway. Operations
6264
// such as Fetch, Push use sync.RLock(), while Delete uses sync.Lock().
6365
sync sync.RWMutex
64-
// indexLock ensures that only one process is writing to the index.
66+
// indexLock ensures that only one go-routine is writing to the index.
6567
indexLock sync.Mutex
6668
}
6769

@@ -141,7 +143,7 @@ func (s *Store) Exists(ctx context.Context, target ocispec.Descriptor) (bool, er
141143

142144
// Delete deletes the content matching the descriptor from the store. Delete may
143145
// fail on certain systems (i.e. NTFS), if there is a process (i.e. an unclosed
144-
// Reader) using `target`.
146+
// Reader) using target.
145147
func (s *Store) Delete(ctx context.Context, target ocispec.Descriptor) error {
146148
s.sync.Lock()
147149
defer s.sync.Unlock()

content/oci/oci_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2064,8 +2064,7 @@ func TestStore_FetchAndDelete(t *testing.T) {
20642064
t.Fatal("error =", err)
20652065
}
20662066
if !bytes.Equal(got, content) {
2067-
fmt.Println(got)
2068-
t.Fatal("wrong content")
2067+
t.Errorf("Store.Fetch() = %v, want %v", string(got), string(content))
20692068
}
20702069
rc.Close()
20712070

0 commit comments

Comments
 (0)