Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kooomix committed Nov 16, 2023
1 parent 39315f6 commit cca6cf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions s3connector/s3_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ func NewS3Mock() S3Mock {
}
}

func (s3 *S3Mock) DeleteObject(key string) error {
func (s3 *S3Mock) DeleteObject(objPath S3ObjectPath) error {
s3.mux.Lock()
defer s3.mux.Unlock()
delete(s3.storage, key)
delete(s3.storage, objPath.Key)
return nil
}

Expand Down
3 changes: 2 additions & 1 deletion s3connector/s3_mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ func TestS3Mock_DeleteObject(t *testing.T) {
mock := NewS3Mock()
mock.storage["keyToDelete"] = "value"

objPath := S3ObjectPath{Key: "keyToDelete"}
// Test deleting existing object
err := mock.DeleteObject("keyToDelete")
err := mock.DeleteObject(objPath)
if err != nil {
t.Errorf("Failed to delete object: %s", err)
}
Expand Down

0 comments on commit cca6cf7

Please sign in to comment.