diff options
author | techknowlogick <techknowlogick@gitea.io> | 2023-02-03 11:23:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-03 11:23:52 -0500 |
commit | cfb1cb1168726a3a4c13aeafaa9728d82e7e84fe (patch) | |
tree | a357604836b7dcc156e02b58ba593cd593f5d2fe /models/db | |
parent | 1410e13dc51030340e280b4637aeafa52defb359 (diff) | |
download | gitea-cfb1cb1168726a3a4c13aeafaa9728d82e7e84fe.tar.gz gitea-cfb1cb1168726a3a4c13aeafaa9728d82e7e84fe.zip |
update to build with go1.20 (#22732)
as title
---------
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/db')
-rw-r--r-- | models/db/sql_postgres_with_schema.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/models/db/sql_postgres_with_schema.go b/models/db/sql_postgres_with_schema.go index ec63447f6f..c2694b37bb 100644 --- a/models/db/sql_postgres_with_schema.go +++ b/models/db/sql_postgres_with_schema.go @@ -37,9 +37,7 @@ func (d *postgresSchemaDriver) Open(name string) (driver.Conn, error) { } schemaValue, _ := driver.String.ConvertValue(setting.Database.Schema) - // golangci lint is incorrect here - there is no benefit to using driver.ExecerContext here - // and in any case pq does not implement it - if execer, ok := conn.(driver.Execer); ok { //nolint + if execer, ok := conn.(driver.Execer); ok { _, err := execer.Exec(`SELECT set_config( 'search_path', $1 || ',' || current_setting('search_path'), @@ -63,8 +61,7 @@ func (d *postgresSchemaDriver) Open(name string) (driver.Conn, error) { // driver.String.ConvertValue will never return err for string - // golangci lint is incorrect here - there is no benefit to using stmt.ExecWithContext here - _, err = stmt.Exec([]driver.Value{schemaValue}) //nolint + _, err = stmt.Exec([]driver.Value{schemaValue}) if err != nil { _ = conn.Close() return nil, err |