Skip to content

Commit 602c3ea

Browse files
committed
Fix errors.Is argument order
1 parent 173b26a commit 602c3ea

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

loopd/daemon.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
892892
defer infof("Static address manager stopped")
893893

894894
err := staticAddressManager.Run(d.mainCtx, initChan)
895-
if err != nil && !errors.Is(context.Canceled, err) {
895+
if err != nil && !errors.Is(err, context.Canceled) {
896896
d.internalErrChan <- err
897897
}
898898
}()
@@ -924,7 +924,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
924924
defer infof("Static address deposit manager stopped")
925925

926926
err := depositManager.Run(d.mainCtx, initChan)
927-
if err != nil && !errors.Is(context.Canceled, err) {
927+
if err != nil && !errors.Is(err, context.Canceled) {
928928
d.internalErrChan <- err
929929
}
930930
}()
@@ -956,7 +956,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
956956
defer infof("Static address withdrawal manager stopped")
957957

958958
err := withdrawalManager.Run(d.mainCtx, initChan)
959-
if err != nil && !errors.Is(context.Canceled, err) {
959+
if err != nil && !errors.Is(err, context.Canceled) {
960960
d.internalErrChan <- err
961961
}
962962
}()
@@ -992,7 +992,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error {
992992
infof("Starting static address loop-in manager...")
993993
defer infof("Static address loop-in manager stopped")
994994
err := staticLoopInManager.Run(d.mainCtx, initChan)
995-
if err != nil && !errors.Is(context.Canceled, err) {
995+
if err != nil && !errors.Is(err, context.Canceled) {
996996
d.internalErrChan <- err
997997
}
998998
}()

loopdb/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func NewBoltSwapStore(dbPath string, chainParams *chaincfg.Params) (
194194
bdb, err := bbolt.Open(path, 0600, &bbolt.Options{
195195
Timeout: DefaultLoopDBTimeout,
196196
})
197-
if err == bbolt.ErrTimeout {
197+
if errors.Is(err, bbolt.ErrTimeout) {
198198
return nil, fmt.Errorf("%w: couldn't obtain exclusive lock on "+
199199
"%s, timed out after %v", bbolt.ErrTimeout, path,
200200
DefaultLoopDBTimeout)

0 commit comments

Comments
 (0)