mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-30 15:15:07 +03:00
Fixed some linter issues
This commit is contained in:
parent
78b5f88e4b
commit
5c3b08c369
5 changed files with 34 additions and 40 deletions
|
@ -60,8 +60,8 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config
|
|||
// throwing everywhere when it's converting things into UTF-16 for the hell
|
||||
// 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(conf[0:2], []byte{0xFF, 0xFE}) == 0 ||
|
||||
bytes.Compare(conf[0:2], []byte{0xFE, 0xFF}) == 0 {
|
||||
if bytes.Equal(conf[0:2], []byte{0xFF, 0xFE}) ||
|
||||
bytes.Equal(conf[0:2], []byte{0xFE, 0xFF}) {
|
||||
utf := unicode.UTF16(unicode.BigEndian, unicode.UseBOM)
|
||||
decoder := utf.NewDecoder()
|
||||
conf, err = decoder.Bytes(conf)
|
||||
|
@ -222,7 +222,7 @@ func main() {
|
|||
getNodeID := func() *crypto.NodeID {
|
||||
if pubkey, err := hex.DecodeString(cfg.EncryptionPublicKey); err == nil {
|
||||
var box crypto.BoxPubKey
|
||||
copy(box[:], pubkey[:])
|
||||
copy(box[:], pubkey)
|
||||
return crypto.GetNodeID(&box)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue