1
0
mirror of https://github.com/golang/go synced 2024-11-17 19:15:21 -07:00
go/src/encoding
Ziheng Liu 42f8199290 all: fix incorrect channel and API usage in some unit tests
This CL changes some unit test functions, making sure that these tests (and goroutines spawned during test) won't block.
Since they are just test functions, I use one CL to fix them all. I hope this won't cause trouble to reviewers and can save time for us.
There are three main categories of incorrect logic fixed by this CL:
1. Use testing.Fatal()/Fatalf() in spawned goroutines, which is forbidden by Go's document.
2. Channels are used in such a way that, when errors or timeout happen, the test will be blocked and never return.
3. Channels are used in such a way that, when errors or timeout happen, the test can return but some spawned goroutines will be leaked, occupying resource until all other tests return and the process is killed.

Change-Id: I3df931ec380794a0cf1404e632c1dd57c65d63e8
Reviewed-on: https://go-review.googlesource.com/c/go/+/219380
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-02-27 19:04:17 +00:00
..
ascii85
asn1 Revert "encoding/asn1: fix unmarshalling SEQUENCE OF SET" 2019-11-08 18:55:44 +00:00
base32 encoding/base32: increase performance and code reuse 2019-09-11 00:56:39 +00:00
base64 all: fix incorrect channel and API usage in some unit tests 2020-02-27 19:04:17 +00:00
binary encoding/binary: add float support to fast path 2019-11-08 18:35:59 +00:00
csv src: gofmt -s 2019-09-09 18:57:05 +00:00
gob all: fix a number of misuses of the word "an" 2019-12-10 16:23:10 +00:00
hex
json encoding/json: consolidate the isSpace function 2020-02-26 17:58:41 +00:00
pem all: remove PEM-encoded private keys from tests 2019-05-21 20:03:55 +00:00
xml all: avoid string(i) where i has type int 2020-02-26 04:38:19 +00:00
encoding.go