Commit Graph

15 Commits

Author SHA1 Message Date
Russ Cox
5f55cee0dc 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: I5b2b7d93424e828a3c5f76ae3f30ab825aca388e
Reviewed-on: https://go-review.googlesource.com/c/net/+/294371
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: Ian Lance Taylor <iant@golang.org>
2021-02-20 03:31:24 +00:00
Lars Lehtonen
f9c8255933 netutil: fix goroutine error handling in test
Change from a done-channel to an error-channel in
TestLimitListenerError() to collect goroutine errors.

Change-Id: I7fb97a4ee18247123c686fd2b3e6f1bfe93de41e
Reviewed-on: https://go-review.googlesource.com/c/net/+/207465
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-11-16 16:09:21 +00:00
Lars Lehtonen
9aaf51ad5c netutil: fix test to not t.Fatal from goroutine
Change-Id: I07941ecadf7d7268542d13b402436b6111772d02
GitHub-Last-Rev: aece213e50
GitHub-Pull-Request: golang/net#57
Reviewed-on: https://go-review.googlesource.com/c/net/+/203877
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2019-11-08 22:12:41 +00:00
Mikio Hara
63eda1eb06 all: use of nettest, remove internal/nettest
This change uses the nettest package where possible and removes the
internal/nettest package.

Change-Id: I5615a3ab7957183fecea6b5646df99dbb7c186e2
Reviewed-on: https://go-review.googlesource.com/c/net/+/123057
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2019-03-27 21:43:58 +00:00
Anand K. Mistry
b3c676e531 netutil: unblock LimitListener.Accept on Close
The net.Listener interface specifies that on Close:
// Any blocked Accept operations will be unblocked and return errors.

Fixes golang/go#24458

Change-Id: I4a61a79db9579a40b536aa65c8077da87aa25156
Reviewed-on: https://go-review.googlesource.com/101535
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-04-04 17:47:46 +00:00
Dmitri Shuralyov
5d997795f7 all: make copyright headers consistent with one space after period
Go policy has been single space after periods in comments for some time.

The copyright header template at:

	https://golang.org/doc/contribute.html#copyright

also uses a single space.

Make them all consistent.

This CL was generated with:

	perl -i -npe 's,^(// Copyright [0-9]+ The Go Authors\.)  (All rights reserved\.)$,$1 $2,' $(git grep -l -E '^// Copyright [0-9]+ The Go Authors\.  All rights reserved\.$')

Follows https://golang.org/cl/20111.

Change-Id: I66671dddf821f5dc027bc254e0196b3e3a2bdf3b
Reviewed-on: https://go-review.googlesource.com/32878
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-07 23:52:11 +00:00
David Symonds
21af302bb5 netutil: Ditch go1.3 build tag.
We only support Go 1.4+ nowadays; Go 1.2 and earlier are ancient.

Change-Id: I128998550afbf287ad797bb9df905b31af0ff952
Reviewed-on: https://go-review.googlesource.com/17791
Run-TryBot: David Symonds <dsymonds@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-14 00:45:27 +00:00
Mikio Hara
8bfde94a84 netutil: deflake TestLimitListener (again)
This change adds missing accept-queue length check.

Change-Id: Ifefc5c614a1a34af51411976ced096c55b95fb8f
Reviewed-on: https://go-review.googlesource.com/11536
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-06-27 00:13:35 +00:00
Mikio Hara
af03a19e5e netutil, internal/nettest: deflake TestLimitListener
Change-Id: Ic82974bcafa1723c96ece0b6b0b717b00b27774b
Reviewed-on: https://go-review.googlesource.com/11533
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-26 04:58:29 +00:00
David Symonds
8aa6e209cb net: add import comments.
Change-Id: Ifab0fdaec1d810d268b7c19ad30f476802203b37
2014-12-09 14:17:11 +11:00
Brad Fitzpatrick
a479876f52 netutil: release semaphore on error
Also rewrite it a bit for clarity (IMO).

LGTM=pzm, r
R=pzm, adg, r
CC=golang-codereviews
https://golang.org/cl/96560043
2014-05-22 11:59:35 -07:00
Andrew Gerrand
c286e198d6 go.net/netutil: don't run test on versions of Go prior to 1.3
LGTM=mikioh.mikioh
R=mikioh.mikioh, minux.ma
CC=golang-codereviews
https://golang.org/cl/97970045
2014-05-05 00:38:37 -04:00
Mikio Hara
c5088f4913 go.net/netutil: fix unintentional test deadlock on resource starvation
It's been observed when the node under test has a tiny resource
configutation or package http has changed the behavior of its own
active connection pool.

For example,
http://build.golang.org/log/8912bc0944628cf1b4fe4063a77d36d19f9dd6a3

LGTM=adg
R=adg
CC=golang-codereviews
https://golang.org/cl/78640043
2014-03-20 04:05:24 +09:00
Andrew Gerrand
ee2e27e1c7 go.net/netutil: LimitListener: avoid deadlock on multiple Close calls
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12967043
2013-08-15 13:52:04 +10:00
Andrew Gerrand
beab8eb873 go.net: add netutil package with LimitListener
Update golang/go#6012

R=golang-dev, dsymonds, rsc
CC=golang-dev
https://golang.org/cl/12727043
2013-08-14 11:00:04 +10:00