From 2fcda8b90a94e63aa0b47690409f32943103300f Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Mon, 2 Mar 2020 19:03:00 +0000 Subject: [PATCH] go fmt --- add.go | 10 +++++----- types.go | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/add.go b/add.go index 62718e4..c8091a3 100644 --- a/add.go +++ b/add.go @@ -1,6 +1,6 @@ package dsnet -func Add(hostname string, owner string, description string) {//, publicKey string) { +func Add(hostname string, owner string, description string) { //, publicKey string) { conf := MustLoadDsnetConfig() privateKey := GenerateJSONPrivateKey() @@ -12,10 +12,10 @@ func Add(hostname string, owner string, description string) {//, publicKey strin check(err) peer := PeerConfig{ - Owner: owner, - Hostname: hostname, - Description: description, - PublicKey: publicKey, + Owner: owner, + Hostname: hostname, + Description: description, + PublicKey: publicKey, PresharedKey: presharedKey, // TODO Endpoint: // TODO pick an available IP AllowedIPs diff --git a/types.go b/types.go index be051ff..717c7a5 100644 --- a/types.go +++ b/types.go @@ -2,12 +2,12 @@ package dsnet import ( "encoding/json" + "errors" + "fmt" "io/ioutil" "net" "strings" "time" - "fmt" - "errors" "golang.zx2c4.com/wireguard/wgctrl/wgtypes" ) @@ -100,8 +100,8 @@ func (conf DsnetConfig) ChooseIP() (net.IP, error) { network := conf.Network.IPNet ones, bits := network.Mask.Size() zeros := bits - ones - min := 1 // avoids network addr - max := (1 << zeros) -2 // avoids broadcast addr + overflow + min := 1 // avoids network addr + max := (1 << zeros) - 2 // avoids broadcast addr + overflow for i := min; i <= max; i++ { IP := make(net.IP, len(network.IP))