We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4d545c commit 0289b78Copy full SHA for 0289b78
modules/globallock/globallock.go
@@ -38,7 +38,7 @@ func TryLock(ctx context.Context, key string) (bool, context.Context, ReleaseFun
38
}
39
40
// LockAndDo tries to acquire a lock for the given key and then calls the given function.
41
-// It uses the default locker.
+// It uses the default locker, and it will return an error if failed to acquire the lock.
42
func LockAndDo(ctx context.Context, key string, f func(context.Context) error) error {
43
ctx, release, err := Lock(ctx, key)
44
if err != nil {
0 commit comments