Skip to content

Commit

Permalink
Merge branch 'main' into respect-context-cancellation-in-filesystem
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn authored Jan 31, 2023
2 parents 159aba5 + ae1c52a commit 345d3b9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions inmem.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ func NewInMemBucket() *InMemBucket {
}
}

// Objects returns internally stored objects.
// Objects returns a copy of the internally stored objects.
// NOTE: For assert purposes.
func (b *InMemBucket) Objects() map[string][]byte {
return b.objects
b.mtx.RLock()
defer b.mtx.RUnlock()

objs := make(map[string][]byte)
for k, v := range b.objects {
objs[k] = v
}

return objs
}

// Iter calls f for each entry in the given directory. The argument to f is the full
Expand Down

0 comments on commit 345d3b9

Please sign in to comment.