]> Cypherpunks repositories - gostls13.git/commit
doc: add note about missing lock in sample code
authorFerenc Szabo <frncmx@gmail.com>
Thu, 25 Jun 2020 09:12:50 +0000 (11:12 +0200)
committerRob Pike <r@golang.org>
Tue, 30 Jun 2020 13:02:41 +0000 (13:02 +0000)
commitc4fd3f6ff60189ba18446d538523b646f37f930b
treef791724eb24d264ed80c2cdb9e231dfc1acd841d
parent8c521739f27bd745bde0dcb3d5c9a332b06a6a42
doc: add note about missing lock in sample code

The sample code in 'Interfaces and methods' section contains a
data race. Handlers are served concurrently. The handler does write
and read operations; `go test -race` would fail (with concurrent
requests). Since the doc is frozen and the code remains less
cluttered without locks/atomic, don't change the sample code.

Change-Id: I654b324d2f0b7f48497822751907c7d39e2f0e3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/239877
Reviewed-by: Rob Pike <r@golang.org>
doc/effective_go.html