global: stop using ioutil
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
4e439ea10e
commit
8bf4204d2e
@ -10,7 +10,7 @@ import (
|
|||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -402,7 +402,7 @@ func BenchmarkUAPIGet(b *testing.B) {
|
|||||||
b.ReportAllocs()
|
b.ReportAllocs()
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
pair[0].dev.IpcGetOperation(ioutil.Discard)
|
pair[0].dev.IpcGetOperation(io.Discard)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ package tun
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -138,7 +137,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
|
|||||||
if err == nil && name == "utun" {
|
if err == nil && name == "utun" {
|
||||||
fname := os.Getenv("WG_TUN_NAME_FILE")
|
fname := os.Getenv("WG_TUN_NAME_FILE")
|
||||||
if fname != "" {
|
if fname != "" {
|
||||||
ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
|
os.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ package tun
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -132,7 +131,7 @@ func CreateTUN(name string, mtu int) (Device, error) {
|
|||||||
if err == nil && name == "tun" {
|
if err == nil && name == "tun" {
|
||||||
fname := os.Getenv("WG_TUN_NAME_FILE")
|
fname := os.Getenv("WG_TUN_NAME_FILE")
|
||||||
if fname != "" {
|
if fname != "" {
|
||||||
ioutil.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
|
os.WriteFile(fname, []byte(tun.(*NativeTun).name+"\n"), 0400)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user