From: Sergey Matveev Date: Thu, 8 Dec 2016 20:30:48 +0000 (+0300) Subject: It is better to work directly with structs, returning pointer when necessary X-Git-Tag: 7.1^2~24 X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=commitdiff_plain;h=6389874fdb1a6a909cbd8a52d93eb5215bd38503 It is better to work directly with structs, returning pointer when necessary --- diff --git a/src/cypherpunks.ru/govpn/client/client.go b/src/cypherpunks.ru/govpn/client/client.go index 8e796f7..76635a8 100644 --- a/src/cypherpunks.ru/govpn/client/client.go +++ b/src/cypherpunks.ru/govpn/client/client.go @@ -129,7 +129,7 @@ MainCycle: } func NewClient(conf Configuration, verifier *govpn.Verifier, termSignal chan os.Signal) *Client { - client := &Client{ + client := Client{ idsCache: govpn.NewMACCache(), firstUpCall: true, config: conf, @@ -138,5 +138,5 @@ func NewClient(conf Configuration, verifier *govpn.Verifier, termSignal chan os. } confs := map[govpn.PeerId]*govpn.PeerConf{*verifier.Id: conf.Peer} client.idsCache.Update(&confs) - return client + return &client }