Style
This commit is contained in:
parent
4a177de09c
commit
142e53f698
1
main.go
1
main.go
|
@ -148,7 +148,6 @@ func main() {
|
||||||
|
|
||||||
logger.Debug.Println("Debug log enabled")
|
logger.Debug.Println("Debug log enabled")
|
||||||
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error.Println("Failed to create TUN device:", err)
|
logger.Error.Println("Failed to create TUN device:", err)
|
||||||
os.Exit(ExitSetupFailed)
|
os.Exit(ExitSetupFailed)
|
||||||
|
|
|
@ -46,7 +46,7 @@ var sockaddrCtlSize uintptr = 32
|
||||||
|
|
||||||
func CreateTUN(name string) (TUNDevice, error) {
|
func CreateTUN(name string) (TUNDevice, error) {
|
||||||
ifIndex := -1
|
ifIndex := -1
|
||||||
if (name != "utun") {
|
if name != "utun" {
|
||||||
fmt.Sscanf(name, "utun%d", &ifIndex)
|
fmt.Sscanf(name, "utun%d", &ifIndex)
|
||||||
if ifIndex < 0 {
|
if ifIndex < 0 {
|
||||||
return nil, fmt.Errorf("Interface name must be utun[0-9]*")
|
return nil, fmt.Errorf("Interface name must be utun[0-9]*")
|
||||||
|
|
|
@ -11,6 +11,7 @@ package main
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -19,7 +20,6 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"bytes"
|
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
Loading…
Reference in a new issue