5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-12-26 11:15:41 +00:00

Merge pull request #134 from Arceliar/develop

clean up main yggdrasil.go imports and run gofmt
This commit is contained in:
Arceliar 2018-06-15 04:42:32 -05:00 committed by GitHub
commit 21b15c97a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,27 +1,29 @@
package main
import "bytes"
import "encoding/hex"
import "encoding/json"
import "flag"
import "fmt"
import "io/ioutil"
import "os"
import "os/signal"
import "syscall"
import "time"
import "regexp"
import "math/rand"
import "log"
import (
"bytes"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/signal"
"regexp"
"syscall"
"time"
import "golang.org/x/text/encoding/unicode"
"golang.org/x/text/encoding/unicode"
import "yggdrasil"
import "yggdrasil/config"
"github.com/kardianos/minwinsvc"
"github.com/mitchellh/mapstructure"
"github.com/neilalexander/hjson-go"
import "github.com/kardianos/minwinsvc"
import "github.com/neilalexander/hjson-go"
import "github.com/mitchellh/mapstructure"
"yggdrasil"
"yggdrasil/config"
)
type nodeConfig = config.NodeConfig
type Core = yggdrasil.Core
@ -115,7 +117,7 @@ func main() {
// 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
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)
decoder := utf.NewDecoder()
config, err = decoder.Bytes(config)