Skip to content

Commit

Permalink
Change FindById to FindByID
Browse files Browse the repository at this point in the history
  • Loading branch information
totemcaf committed Oct 17, 2022
1 parent d206c9e commit 15799cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion repositories/in_memory_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (r *InMemoryRepository[Key, Entity]) Delete(key Key) error {
return nil
}

func (r *InMemoryRepository[Key, Entity]) FindById(key Key) (Entity, error) {
func (r *InMemoryRepository[Key, Entity]) FindByID(key Key) (Entity, error) {
r.lock.RLock()
defer r.lock.RUnlock()
r.init()
Expand Down
4 changes: 2 additions & 2 deletions repositories/in_memory_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func Test_added_element_it_is_found(t *testing.T) {

_, _ = repo.Create(toStore)

entity, err := repo.FindById(Key1)
entity, err := repo.FindByID(Key1)
assert.Nil(t, err)
assert.Equal(t, toStore, entity)
}
Expand Down Expand Up @@ -107,7 +107,7 @@ func Test_Update_replace_entity(t *testing.T) {
_, _ = repo.Create(&entity{Key1, 42})
_, _ = repo.Update(&entity{Key1, 4242})

entity, err := repo.FindById(Key1)
entity, err := repo.FindByID(Key1)

assert.Nil(t, err)
assert.Equal(t, Key1, entity.Id)
Expand Down

0 comments on commit 15799cd

Please sign in to comment.