summaryrefslogtreecommitdiffstats
path: root/models/db
diff options
context:
space:
mode:
Diffstat (limited to 'models/db')
-rwxr-xr-xmodels/db/engine.go2
-rw-r--r--models/db/index.go2
-rw-r--r--models/db/list_options.go2
-rw-r--r--models/db/sql_postgres_with_schema.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/models/db/engine.go b/models/db/engine.go
index 8a3b4b206e..93cf5ad8bc 100755
--- a/models/db/engine.go
+++ b/models/db/engine.go
@@ -285,5 +285,5 @@ func DeleteAllRecords(tableName string) error {
// GetMaxID will return max id of the table
func GetMaxID(beanOrTableName interface{}) (maxID int64, err error) {
_, err = x.Select("MAX(id)").Table(beanOrTableName).Get(&maxID)
- return
+ return maxID, err
}
diff --git a/models/db/index.go b/models/db/index.go
index 9b164db1fa..673c382b27 100644
--- a/models/db/index.go
+++ b/models/db/index.go
@@ -44,7 +44,7 @@ func UpsertResourceIndex(ctx context.Context, tableName string, groupID int64) (
default:
return fmt.Errorf("database type not supported")
}
- return
+ return err
}
var (
diff --git a/models/db/list_options.go b/models/db/list_options.go
index d1d52b6667..54f6d945c8 100644
--- a/models/db/list_options.go
+++ b/models/db/list_options.go
@@ -58,7 +58,7 @@ func (opts *ListOptions) GetSkipTake() (skip, take int) {
func (opts *ListOptions) GetStartEnd() (start, end int) {
start, take := opts.GetSkipTake()
end = start + take
- return
+ return start, end
}
// SetDefaultValues sets default values
diff --git a/models/db/sql_postgres_with_schema.go b/models/db/sql_postgres_with_schema.go
index d6b6262927..4bbd12bdeb 100644
--- a/models/db/sql_postgres_with_schema.go
+++ b/models/db/sql_postgres_with_schema.go
@@ -44,7 +44,7 @@ func (d *postgresSchemaDriver) Open(name string) (driver.Conn, error) {
_, err := execer.Exec(`SELECT set_config(
'search_path',
$1 || ',' || current_setting('search_path'),
- false)`, []driver.Value{schemaValue}) //nolint
+ false)`, []driver.Value{schemaValue})
if err != nil {
_ = conn.Close()
return nil, err