minor formatting
This commit is contained in:
@@ -7,8 +7,7 @@ import (
|
||||
)
|
||||
|
||||
|
||||
// TODO docstring
|
||||
// Default implementation of IRepository
|
||||
// Default implementation of IRepository using an IDatastore.
|
||||
type DefaultRepository[T IIdentifiable] struct {
|
||||
ds IDatastore
|
||||
prefix string
|
||||
@@ -23,7 +22,6 @@ func NewDefaultRepository[T IIdentifiable](ds IDatastore, prefix string) *Defaul
|
||||
// error if there already exists an entry with the same id, the json encoding
|
||||
// fails or the connection to the IDatastore fails.
|
||||
func (repo *DefaultRepository[T]) Create(t T) error {
|
||||
|
||||
key := repo.prefix + ":" + strconv.FormatUint(uint64(t.Id()), 10)
|
||||
exists, err := repo.ds.KeyExists(key)
|
||||
if err != nil { return err }
|
||||
@@ -42,7 +40,6 @@ func (repo *DefaultRepository[T]) Create(t T) error {
|
||||
// t. Trows an error if the json encoding fails or the connection to the
|
||||
// IDatastore fails.
|
||||
func (repo *DefaultRepository[T]) Update(t T) error {
|
||||
|
||||
key := repo.prefix + ":" + strconv.FormatUint(uint64(t.Id()), 10)
|
||||
exists, err := repo.ds.KeyExists(key)
|
||||
if err != nil { return err }
|
||||
|
||||
Reference in New Issue
Block a user