Commit graph

5 commits

Author SHA1 Message Date
Dmitri Shuralyov
10739b037d all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

While here, simplify package syncmap by taking advantage of knowing
that all supported Go versions will have the go1.9 build constraint
satisfied.

For golang/go#60268.

Change-Id: Ic0f24ab13ada6839573e55beee5516c1a6c7f3cc
Reviewed-on: https://go-review.googlesource.com/c/sync/+/534220
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-10-11 14:04:17 +00:00
Russ Cox
036812b2e8 all: go fmt ./...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: Ie3f0a5f80ab53b95a25db9ccfd9a3cc4ea7ff465
Reviewed-on: https://go-review.googlesource.com/c/sync/+/294370
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2021-02-20 03:29:51 +00:00
Jean de Klerk
42b317875d all: remove x/net/context in favour of context
Change-Id: Idbfe40e7cb9f99ca3dc7d4c214de6b9e028eefb7
Reviewed-on: https://go-review.googlesource.com/c/148277
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-11-08 01:04:31 +00:00
Bryan C. Mills
fd80eb99c8 semaphore: add worker-pool example
I've commented several times in various forums that basically every
time I've seen the “worker goroutine” pattern in Go, there has turned
out to be a cleaner implementation using semaphores.

This change adds a simple such example. (For more complex usage, I
would generally pair the semaphore with an errgroup.Group.)

Change-Id: Ibf69ee761d14ba59c1acc6a2d595b4fcf0d8f6d6
Reviewed-on: https://go-review.googlesource.com/75170
Reviewed-by: Ross Light <light@google.com>
2017-11-01 21:47:15 +00:00
Jonathan Amsterdam
5a06fca2c3 semaphore: add a weighted semaphore implementation
This package provides a weighted semaphore that is context-aware.

The code is derived from a similar package inside Google.

Change-Id: Id1dad96d79e8ccfd289e4299e8265aa5bdad3a5b
Reviewed-on: https://go-review.googlesource.com/38298
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-17 23:16:01 +00:00