Some small refactorings
This commit is contained in:
@@ -12,16 +12,22 @@ type MockShareRepo struct {
|
||||
|
||||
Entity interface{}
|
||||
Cols []string
|
||||
Err error
|
||||
Error error
|
||||
}
|
||||
|
||||
func (m *MockShareRepo) Save(entity interface{}) (string, error) {
|
||||
if m.Error != nil {
|
||||
return "", m.Error
|
||||
}
|
||||
m.Entity = entity
|
||||
return "id", m.Err
|
||||
return "id", nil
|
||||
}
|
||||
|
||||
func (m *MockShareRepo) Update(entity interface{}, cols ...string) error {
|
||||
if m.Error != nil {
|
||||
return m.Error
|
||||
}
|
||||
m.Entity = entity
|
||||
m.Cols = cols
|
||||
return m.Err
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user