]> Cypherpunks.ru repositories - govpn.git/commitdiff
It is better to work directly with structs, returning pointer when necessary
authorSergey Matveev <stargrave@stargrave.org>
Thu, 8 Dec 2016 20:30:48 +0000 (23:30 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 8 Dec 2016 20:30:48 +0000 (23:30 +0300)
src/cypherpunks.ru/govpn/client/client.go

index 8e796f77e4c4249a11d9c9edf888e68f83a23b03..76635a88ec9a9e84e8b456e53943e4cc518a08da 100644 (file)
@@ -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
 }