mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-26 01:21:37 +00:00
Merge pull request #134 from Arceliar/develop
clean up main yggdrasil.go imports and run gofmt
This commit is contained in:
commit
21b15c97a9
42
yggdrasil.go
42
yggdrasil.go
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user