summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-05-05 02:48:21 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-05-05 02:48:21 +0200
commit142e53f69827e6778d809d9606bb7cd4e77694a2 (patch)
tree1cc55aef84a6768f427cc393b4387285d58f0402
parent4a177de09c067ffb94c05f0859d10f78961bd3b4 (diff)
Style
-rw-r--r--main.go1
-rw-r--r--tun_darwin.go2
-rw-r--r--tun_linux.go2
-rw-r--r--uapi_darwin.go4
4 files changed, 4 insertions, 5 deletions
diff --git a/main.go b/main.go
index e7e0488..5001bc4 100644
--- a/main.go
+++ b/main.go
@@ -148,7 +148,6 @@ func main() {
logger.Debug.Println("Debug log enabled")
-
if err != nil {
logger.Error.Println("Failed to create TUN device:", err)
os.Exit(ExitSetupFailed)
diff --git a/tun_darwin.go b/tun_darwin.go
index 5514563..1d66c66 100644
--- a/tun_darwin.go
+++ b/tun_darwin.go
@@ -46,7 +46,7 @@ var sockaddrCtlSize uintptr = 32
func CreateTUN(name string) (TUNDevice, error) {
ifIndex := -1
- if (name != "utun") {
+ if name != "utun" {
fmt.Sscanf(name, "utun%d", &ifIndex)
if ifIndex < 0 {
return nil, fmt.Errorf("Interface name must be utun[0-9]*")
diff --git a/tun_linux.go b/tun_linux.go
index 446cc17..e3e1512 100644
--- a/tun_linux.go
+++ b/tun_linux.go
@@ -11,6 +11,7 @@ package main
*/
import (
+ "bytes"
"encoding/binary"
"errors"
"fmt"
@@ -19,7 +20,6 @@ import (
"net"
"os"
"strconv"
- "bytes"
"strings"
"syscall"
"time"
diff --git a/uapi_darwin.go b/uapi_darwin.go
index 69b0e3d..449fb98 100644
--- a/uapi_darwin.go
+++ b/uapi_darwin.go
@@ -94,9 +94,9 @@ func UAPIListen(name string, file *os.File) (net.Listener, error) {
go func(l *UAPIListener) {
event := unix.Kevent_t{
- Ident: uint64(uapi.keventFd),
+ Ident: uint64(uapi.keventFd),
Filter: unix.EVFILT_VNODE,
- Flags: unix.EV_ADD | unix.EV_ENABLE | unix.EV_ONESHOT,
+ Flags: unix.EV_ADD | unix.EV_ENABLE | unix.EV_ONESHOT,
Fflags: unix.NOTE_WRITE,
}
events := make([]unix.Kevent_t, 1)