Chore: Upgrade golangci-lint to v1.51.2 (#63630)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
co-authored by
Sofia Papagiannaki
parent
c769a6281e
commit
3abaf32cf2
@@ -50,14 +50,20 @@ func updateFolderTree(ctx context.Context, tx *session.SessionTx, tenant int64)
|
||||
}
|
||||
err = rows.Scan(&folder.UID, &folder.parentUID, &folder.Name, &folder.originalSlug)
|
||||
if err != nil {
|
||||
return err
|
||||
break
|
||||
}
|
||||
all = append(all, &folder)
|
||||
}
|
||||
err = rows.Close()
|
||||
errClose := rows.Close()
|
||||
// TODO: Use some kind of multi-error.
|
||||
// Until then, we want to prioritize errors coming from the .Scan
|
||||
// over those coming from .Close.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if errClose != nil {
|
||||
return errClose
|
||||
}
|
||||
|
||||
root, lost, err := buildFolderTree(all)
|
||||
if err != nil {
|
||||
|
||||
@@ -474,15 +474,19 @@ func (s *sqlEntityServer) fillCreationInfo(ctx context.Context, tx *session.Sess
|
||||
}
|
||||
|
||||
rows, err := tx.Query(ctx, "SELECT created_at,created_by FROM entity WHERE grn=?", grn)
|
||||
if err == nil {
|
||||
if rows.Next() {
|
||||
err = rows.Scan(&createdAt, &createdBy)
|
||||
}
|
||||
if err == nil {
|
||||
err = rows.Close()
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
|
||||
if rows.Next() {
|
||||
err = rows.Scan(&createdAt, &createdBy)
|
||||
}
|
||||
|
||||
errClose := rows.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return errClose
|
||||
}
|
||||
|
||||
func (s *sqlEntityServer) selectForUpdate(ctx context.Context, tx *session.SessionTx, grn string) (*entity.EntityVersionInfo, error) {
|
||||
@@ -498,10 +502,13 @@ func (s *sqlEntityServer) selectForUpdate(ctx context.Context, tx *session.Sessi
|
||||
if rows.Next() {
|
||||
err = rows.Scan(¤t.ETag, ¤t.Version, ¤t.UpdatedAt, ¤t.Size)
|
||||
}
|
||||
if err == nil {
|
||||
err = rows.Close()
|
||||
|
||||
errClose := rows.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return current, err
|
||||
|
||||
return current, errClose
|
||||
}
|
||||
|
||||
func (s *sqlEntityServer) writeSearchInfo(
|
||||
|
||||
Reference in New Issue
Block a user