]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
Make successful tests silent
authorFilippo Valsorda <hi@filippo.io>
Mon, 21 May 2018 03:18:25 +0000 (23:18 -0400)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 21 May 2018 18:21:00 +0000 (20:21 +0200)
License: MIT
Signed-off-by: Filippo Valsorda <valsorda@google.com>
device_test.go
send.go

index bafebe247d6d3b8dfae45027191a0fdb3240a93a..c117116c971be9cce6d5f01d02705cc39790a8d3 100644 (file)
@@ -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 5c1258958f51ee7ba89628f296dde39af3eab0bb..311faccbe63b016781b3a38562dcd33637d82b6f 100644 (file)
--- 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
                }