clean up main yggdrasil.go imports and run gofmt

This commit is contained in:
Arceliar 2018-06-15 04:30:09 -05:00
parent 5fc4dddf83
commit e65a66b181

View File

@ -1,27 +1,29 @@
package main package main
import "bytes" import (
import "encoding/hex" "bytes"
import "encoding/json" "encoding/hex"
import "flag" "encoding/json"
import "fmt" "flag"
import "io/ioutil" "fmt"
import "os" "io/ioutil"
import "os/signal" "log"
import "syscall" "math/rand"
import "time" "os"
import "regexp" "os/signal"
import "math/rand" "regexp"
import "log" "syscall"
"time"
import "golang.org/x/text/encoding/unicode" "golang.org/x/text/encoding/unicode"
import "yggdrasil" "github.com/kardianos/minwinsvc"
import "yggdrasil/config" "github.com/mitchellh/mapstructure"
"github.com/neilalexander/hjson-go"
import "github.com/kardianos/minwinsvc" "yggdrasil"
import "github.com/neilalexander/hjson-go" "yggdrasil/config"
import "github.com/mitchellh/mapstructure" )
type nodeConfig = config.NodeConfig type nodeConfig = config.NodeConfig
type Core = yggdrasil.Core type Core = yggdrasil.Core
@ -115,7 +117,7 @@ func main() {
// of it - remove it and decode back down into UTF-8. This is necessary // of it - remove it and decode back down into UTF-8. This is necessary
// because hjson doesn't know what to do with UTF-16 and will panic // because hjson doesn't know what to do with UTF-16 and will panic
if bytes.Compare(config[0:2], []byte{0xFF, 0xFE}) == 0 || if bytes.Compare(config[0:2], []byte{0xFF, 0xFE}) == 0 ||
bytes.Compare(config[0:2], []byte{0xFF, 0xFF}) == 0 { bytes.Compare(config[0:2], []byte{0xFF, 0xFF}) == 0 {
utf := unicode.UTF16(unicode.BigEndian, unicode.UseBOM) utf := unicode.UTF16(unicode.BigEndian, unicode.UseBOM)
decoder := utf.NewDecoder() decoder := utf.NewDecoder()
config, err = decoder.Bytes(config) config, err = decoder.Bytes(config)