More slices instead of pointers of slice
This commit is contained in:
@@ -35,13 +35,13 @@ func (r *albumRepository) FindByArtist(artistId string) (*domain.Albums, error)
|
||||
return &as, err
|
||||
}
|
||||
|
||||
func (r *albumRepository) GetAll(options domain.QueryOptions) (*domain.Albums, error) {
|
||||
func (r *albumRepository) GetAll(options domain.QueryOptions) (domain.Albums, error) {
|
||||
var as = make(domain.Albums, 0)
|
||||
err := r.loadAll(&as, options)
|
||||
return &as, err
|
||||
return as, err
|
||||
}
|
||||
|
||||
func (r *albumRepository) GetAllIds() (*[]string, error) {
|
||||
func (r *albumRepository) GetAllIds() ([]string, error) {
|
||||
idMap, err := r.getAllIds()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -54,7 +54,7 @@ func (r *albumRepository) GetAllIds() (*[]string, error) {
|
||||
i++
|
||||
}
|
||||
|
||||
return &ids, nil
|
||||
return ids, nil
|
||||
}
|
||||
|
||||
func (r *albumRepository) PurgeInactive(active domain.Albums) ([]string, error) {
|
||||
|
||||
@@ -51,12 +51,12 @@ func (m *MockAlbum) Get(id string) (*domain.Album, error) {
|
||||
return nil, domain.ErrNotFound
|
||||
}
|
||||
|
||||
func (m *MockAlbum) GetAll(qo domain.QueryOptions) (*domain.Albums, error) {
|
||||
func (m *MockAlbum) GetAll(qo domain.QueryOptions) (domain.Albums, error) {
|
||||
m.Options = qo
|
||||
if m.err {
|
||||
return nil, errors.New("Error!")
|
||||
}
|
||||
return &m.all, nil
|
||||
return m.all, nil
|
||||
}
|
||||
|
||||
func (m *MockAlbum) FindByArtist(artistId string) (*domain.Albums, error) {
|
||||
|
||||
Reference in New Issue
Block a user