sync/errgroup: improve documentation for semaphore limit behavior

Updated the documentation for `SetLimit` and `Go` functions in the
`errgroup` package. the note clarifies the behavior when the semaphore
limit is set to zero, which could lead to a deadlock if not handled
properly. the updated documentation warns users to set a positive
semaphore limit to avoid blocking goroutines and potential deadlock

this change improves the clarity of API and helps users understand how
to properly use the semaphore limit to prevent issues in concurrent
execution

Change-Id: Ie62acc38ef804b3590c04bddba00a3cce21e8cef
Reviewed-on: https://go-review.googlesource.com/c/sync/+/642215
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
1 file changed
tree: 2568876928e5d2458b07069096b2fa30bbde4782
  1. errgroup/
  2. semaphore/
  3. singleflight/
  4. syncmap/
  5. codereview.cfg
  6. CONTRIBUTING.md
  7. go.mod
  8. LICENSE
  9. PATENTS
  10. README.md
README.md

Go Sync

Go Reference

This repository provides Go concurrency primitives in addition to the ones provided by the language and “sync” and “sync/atomic” packages.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/sync.

The main issue tracker for the sync repository is located at https://go.dev/issues. Prefix your issue with “x/sync:” in the subject line, so it is easy to find.