mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-26 03:41:01 +00:00
Use NullString instead of checking for error.
This commit is contained in:
parent
44ffb70813
commit
7eb06fc0d5
1 changed files with 4 additions and 7 deletions
|
@ -326,16 +326,13 @@ func (s *sqliteDriver) getIndexDefinition(tableName string) ([]string, error) {
|
|||
}
|
||||
|
||||
for rows.Next() {
|
||||
var sql string
|
||||
var sql sql.NullString
|
||||
if err := rows.Scan(&sql); err != nil {
|
||||
// This error came from autoindex, since its sql value is null,
|
||||
// we want to continue.
|
||||
if strings.Contains(err.Error(), "Scan pair: <nil> -> *string") {
|
||||
continue
|
||||
}
|
||||
return sqls, err
|
||||
}
|
||||
sqls = append(sqls, sql)
|
||||
if sql.Valid {
|
||||
sqls = append(sqls, sql.String)
|
||||
}
|
||||
}
|
||||
|
||||
if err := rows.Err(); err != nil {
|
||||
|
|
Loading…
Reference in a new issue