diff --git a/repositories/in_memory_repository.go b/repositories/in_memory_repository.go index 244c73b..a908269 100644 --- a/repositories/in_memory_repository.go +++ b/repositories/in_memory_repository.go @@ -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() diff --git a/repositories/in_memory_repository_test.go b/repositories/in_memory_repository_test.go index 1ef34b5..b426d68 100644 --- a/repositories/in_memory_repository_test.go +++ b/repositories/in_memory_repository_test.go @@ -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) } @@ -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)