refactor(sql): replace multierr with errors.Join
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
f87a2fb5b6
commit
7dbb8566b3
2 changed files with 6 additions and 5 deletions
2
go.mod
2
go.mod
|
@ -14,7 +14,6 @@ require (
|
||||||
github.com/mitchellh/mapstructure v1.5.0
|
github.com/mitchellh/mapstructure v1.5.0
|
||||||
github.com/testcontainers/testcontainers-go v0.17.0
|
github.com/testcontainers/testcontainers-go v0.17.0
|
||||||
github.com/valyala/bytebufferpool v1.0.0
|
github.com/valyala/bytebufferpool v1.0.0
|
||||||
go.uber.org/multierr v1.9.0
|
|
||||||
go.uber.org/zap v1.24.0
|
go.uber.org/zap v1.24.0
|
||||||
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
|
golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
|
||||||
golang.org/x/sync v0.1.0
|
golang.org/x/sync v0.1.0
|
||||||
|
@ -55,6 +54,7 @@ require (
|
||||||
github.com/sirupsen/logrus v1.9.0 // indirect
|
github.com/sirupsen/logrus v1.9.0 // indirect
|
||||||
go.uber.org/atomic v1.10.0 // indirect
|
go.uber.org/atomic v1.10.0 // indirect
|
||||||
go.uber.org/goleak v1.1.12 // indirect
|
go.uber.org/goleak v1.1.12 // indirect
|
||||||
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
golang.org/x/crypto v0.6.0 // indirect
|
golang.org/x/crypto v0.6.0 // indirect
|
||||||
golang.org/x/net v0.6.0 // indirect
|
golang.org/x/net v0.6.0 // indirect
|
||||||
golang.org/x/sys v0.5.0 // indirect
|
golang.org/x/sys v0.5.0 // indirect
|
||||||
|
|
|
@ -3,8 +3,7 @@ package sql
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"errors"
|
||||||
"go.uber.org/multierr"
|
|
||||||
|
|
||||||
"code.icb4dc0.de/prskr/nurse/check"
|
"code.icb4dc0.de/prskr/nurse/check"
|
||||||
"code.icb4dc0.de/prskr/nurse/config"
|
"code.icb4dc0.de/prskr/nurse/config"
|
||||||
|
@ -66,8 +65,10 @@ func (s *SelectCheck) executeAttempt(ctx context.Context) (err error) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer multierr.AppendInvoke(&err, multierr.Close(rows))
|
defer func() {
|
||||||
defer multierr.AppendInvoke(&err, multierr.Invoke(rows.Err))
|
err = errors.Join(rows.Close(), rows.Err())
|
||||||
|
}()
|
||||||
|
|
||||||
|
|
||||||
return s.validators.Validate(rows)
|
return s.validators.Validate(rows)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue