summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilippo Valsorda <hi@filippo.io>2018-05-20 23:18:25 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-21 20:21:00 +0200
commit84f52ce0d690c2377b032c8fc42b591930822d7e (patch)
tree596613f3b1fed60f44e70c321cedc8b6055f8472
parentProperly close DummyTUN to avoid deadlock in TestNoiseHandshake (diff)
downloadwireguard-go-84f52ce0d690c2377b032c8fc42b591930822d7e.tar.xz
wireguard-go-84f52ce0d690c2377b032c8fc42b591930822d7e.zip
Make successful tests silent
License: MIT Signed-off-by: Filippo Valsorda <valsorda@google.com>
-rw-r--r--device_test.go8
-rw-r--r--send.go6
2 files changed, 8 insertions, 6 deletions
diff --git a/device_test.go b/device_test.go
index bafebe2..c117116 100644
--- a/device_test.go
+++ b/device_test.go
@@ -26,8 +26,8 @@ func TestDevice(t *testing.T) {
t.Error("failed to create tun:", err.Error())
}
- println(tun1)
- println(tun2)
+ _ = tun1
+ _ = tun2
// prepare endpoints
@@ -41,8 +41,8 @@ func TestDevice(t *testing.T) {
t.Error("failed to create endpoint:", err.Error())
}
- println(end1)
- println(end2)
+ _ = end1
+ _ = end2
// create binds
diff --git a/send.go b/send.go
index 5c12589..311facc 100644
--- a/send.go
+++ b/send.go
@@ -264,8 +264,10 @@ func (device *Device) RoutineReadFromTUN() {
size, err := device.tun.device.Read(elem.buffer[:], offset)
if err != nil {
- logError.Println("Failed to read packet from TUN device:", err)
- device.Close()
+ if !device.isClosed.Get() {
+ logError.Println("Failed to read packet from TUN device:", err)
+ device.Close()
+ }
return
}