]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
global: stop using ioutil
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 17 Feb 2021 21:19:27 +0000 (22:19 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 17 Feb 2021 21:19:27 +0000 (22:19 +0100)
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
device/device_test.go
tun/tun_darwin.go
tun/tun_openbsd.go

index 02b1c35a3b4451c7b2c2e704aaa366177a7f456f..7958fb9c4b7dcb39f77b0434a074f98cfa0197fe 100644 (file)
@@ -10,7 +10,7 @@ import (
        "encoding/hex"
        "errors"
        "fmt"
-       "io/ioutil"
+       "io"
        "math/rand"
        "net"
        "runtime"
@@ -402,7 +402,7 @@ func BenchmarkUAPIGet(b *testing.B) {
        b.ReportAllocs()
        b.ResetTimer()
        for i := 0; i < b.N; i++ {
-               pair[0].dev.IpcGetOperation(ioutil.Discard)
+               pair[0].dev.IpcGetOperation(io.Discard)
        }
 }
 
index f513d03b86779197884825bf06a465964fa0bc11..542f666dbeb29d595204ecd535e451611904f620 100644 (file)
@@ -8,7 +8,6 @@ package tun
 import (
        "errors"
        "fmt"
-       "io/ioutil"
        "net"
        "os"
        "syscall"
@@ -138,7 +137,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
        if err == nil && name == "utun" {
                fname := os.Getenv("WG_TUN_NAME_FILE")
                if fname != "" {
-                       ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
+                       os.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
                }
        }
 
index b2815d7d7b9ced59755d15ac6678496a97651ac7..8fca1e34537696930e7ff9b7d18f399393c626a4 100644 (file)
@@ -8,7 +8,6 @@ package tun
 import (
        "errors"
        "fmt"
-       "io/ioutil"
        "net"
        "os"
        "syscall"
@@ -132,7 +131,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
        if err == nil && name == "tun" {
                fname := os.Getenv("WG_TUN_NAME_FILE")
                if fname != "" {
-                       ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
+                       os.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
                }
        }