Skip to content

Commit 0289b78

Browse files
committed
chore: improve comment
1 parent f4d545c commit 0289b78

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/globallock/globallock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func TryLock(ctx context.Context, key string) (bool, context.Context, ReleaseFun
3838
}
3939

4040
// LockAndDo tries to acquire a lock for the given key and then calls the given function.
41-
// It uses the default locker.
41+
// It uses the default locker, and it will return an error if failed to acquire the lock.
4242
func LockAndDo(ctx context.Context, key string, f func(context.Context) error) error {
4343
ctx, release, err := Lock(ctx, key)
4444
if err != nil {

0 commit comments

Comments
 (0)