Skip to content

Commit c7cb288

Browse files
denikIsaac
andcommitted
locker: use errors.AsType
Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 84af228 commit c7cb288

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎libs/locker/locker.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (locker *Locker) Unlock(ctx context.Context, opts ...UnlockOption) error {
199199
}
200200

201201
err := locker.assertLockHeld(ctx)
202-
if errors.As(err, &lockNotHeldError{}) {
202+
if _, ok := errors.AsType[lockNotHeldError](err); ok {
203203
return fmt.Errorf("unlock called when lock is not held: %w", err)
204204
}
205205
if err != nil {

0 commit comments

Comments
 (0)