mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 04:39:56 +00:00
TUN-4060: Fix Go Vet warnings (new with go 1.16) where t.Fatalf is called from a test goroutine
This commit is contained in:
@@ -663,7 +663,8 @@ func AssertIfPipeReadable(t *testing.T, pipe io.ReadCloser) {
|
||||
b := []byte{0}
|
||||
n, err := pipe.Read(b)
|
||||
if n > 0 {
|
||||
t.Fatalf("read pipe was not empty")
|
||||
t.Errorf("read pipe was not empty")
|
||||
return
|
||||
}
|
||||
errC <- err
|
||||
}()
|
||||
|
@@ -81,7 +81,8 @@ func TestSharedBufferConcurrentReadWrite(t *testing.T) {
|
||||
expectedResult.Write(block[:blockSize])
|
||||
n, err := b.Write(block[:blockSize])
|
||||
if n != blockSize || err != nil {
|
||||
t.Fatalf("write error: %d %s", n, err)
|
||||
t.Errorf("write error: %d %s", n, err)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +95,8 @@ func TestSharedBufferConcurrentReadWrite(t *testing.T) {
|
||||
for i := 0; i < 256; i++ {
|
||||
n, err := io.ReadFull(b, block[:blockSize])
|
||||
if n != blockSize || err != nil {
|
||||
t.Fatalf("read error: %d %s", n, err)
|
||||
t.Errorf("read error: %d %s", n, err)
|
||||
return
|
||||
}
|
||||
actualResult.Write(block[:blockSize])
|
||||
}
|
||||
|
Reference in New Issue
Block a user