reformat state access and errors handling

This commit is contained in:
d1slike committed 2019-10-12 12:53:20 +03:00
1 parent b1a0bc252f
commit c31abb84c9
29 files changed
+451 -448

No files matched your search

+2 -3
View File
@@ -17,10 +17,9 @@ type commonConfigRepPg struct {
}
func (r *commonConfigRepPg) Snapshot() ([]entity.CommonConfig, error) {
var configs []entity.CommonConfig
configs := make([]entity.CommonConfig, 0)
err := r.rxClient.Visit(func(db *pg.DB) error {
return db.Model(&configs).
Select()
return db.Model(&configs).Select()
})
return configs, err
}
+2 -3
View File
@@ -17,10 +17,9 @@ type configRepPg struct {
}
func (r *configRepPg) Snapshot() ([]entity.Config, error) {
var configs []entity.Config
configs := make([]entity.Config, 0)
err := r.rxClient.Visit(func(db *pg.DB) error {
return db.Model(&configs).
Select()
return db.Model(&configs).Select()
})
return configs, err
}
+2 -3
View File
@@ -17,10 +17,9 @@ type modulesRepPg struct {
}
func (r *modulesRepPg) Snapshot() ([]entity.Module, error) {
var modules []entity.Module
modules := make([]entity.Module, 0)
err := r.rxClient.Visit(func(db *pg.DB) error {
return db.Model(&modules).
Select()
return db.Model(&modules).Select()
})
return modules, err
}
+2 -3
View File
@@ -16,10 +16,9 @@ type schemaRepPg struct {
}
func (r *schemaRepPg) Snapshot() ([]entity.ConfigSchema, error) {
var schemas []entity.ConfigSchema
schemas := make([]entity.ConfigSchema, 0)
err := r.rxClient.Visit(func(db *pg.DB) error {
return db.Model(&schemas).
Select()
return db.Model(&schemas).Select()
})
return schemas, err
}