]> Cypherpunks.ru repositories - govpn.git/commitdiff
go fmt code
authorSergey Matveev <stargrave@stargrave.org>
Thu, 8 Dec 2016 19:53:40 +0000 (22:53 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 8 Dec 2016 19:53:40 +0000 (22:53 +0300)
src/cypherpunks.ru/govpn/client/client.go
src/cypherpunks.ru/govpn/client/proxy.go
src/cypherpunks.ru/govpn/cmd/govpn-client/main.go

index ac54a860e127c7d558de5d8b5f0b9dc4730647f4..cfeba815de38bf0585a974aa0ea4311c540b688d 100644 (file)
@@ -1,13 +1,14 @@
 package client
 
 import (
+       "errors"
        "fmt"
        "net"
        "os"
-       "errors"
        "time"
 
        "github.com/agl/ed25519"
+
        "cypherpunks.ru/govpn"
 )
 
@@ -34,7 +35,7 @@ type Configuration struct {
 
 func (c *Configuration) Validate() error {
        if c.MTU > govpn.MTUMax {
-               return fmt.Errorf("Invalid MTU %d, maximum allowable is %d",c.MTU, govpn.MTUMax)
+               return fmt.Errorf("Invalid MTU %d, maximum allowable is %d", c.MTU, govpn.MTUMax)
        }
        if len(c.RemoteAddress) == 0 {
                return errors.New("Missing RemoteAddress")
@@ -62,7 +63,7 @@ type Client struct {
        config        Configuration
 
        // Error receive any error of all routines
-       Error         chan error
+       Error chan error
 }
 
 func (c *Client) MainCycle() {
@@ -83,7 +84,7 @@ func (c *Client) MainCycle() {
                go govpn.StatsProcessor(c.statsPort, &c.knownPeers)
        }
 
-       MainCycle:
+MainCycle:
        for {
                c.timeouted = make(chan struct{})
                c.rehandshaking = make(chan struct{})
@@ -124,11 +125,11 @@ func (c *Client) MainCycle() {
 
 func NewClient(conf Configuration, verifier *govpn.Verifier, termSignal chan os.Signal) *Client {
        client := &Client{
-               idsCache: govpn.NewMACCache(),
+               idsCache:    govpn.NewMACCache(),
                firstUpCall: true,
-               config: conf,
-               termSignal: termSignal,
-               Error: make(chan error, 1),
+               config:      conf,
+               termSignal:  termSignal,
+               Error:       make(chan error, 1),
        }
        confs := map[govpn.PeerId]*govpn.PeerConf{*verifier.Id: conf.Peer}
        client.idsCache.Update(&confs)
index 9f8e684868b073c02af62ad63fa1b4608a731728..017536bcc904f9849ac7fe83ef2d39d7f68ac0d1 100644 (file)
@@ -21,8 +21,8 @@ package client
 import (
        "bufio"
        "encoding/base64"
-       "net"
        "fmt"
+       "net"
        "net/http"
 
        "cypherpunks.ru/govpn"
index df426ba8820c45bac23d84d83a21e814cf6e5540..d16245ac2de3b153abe22be7a8fa46be8c30cfe6 100644 (file)
@@ -54,8 +54,8 @@ func main() {
                syslog      = flag.Bool("syslog", false, "Enable logging to syslog")
                version     = flag.Bool("version", false, "Print version information")
                warranty    = flag.Bool("warranty", false, "Print warranty information")
-               protocol client.Protocol
-               err error
+               protocol    client.Protocol
+               err         error
        )
 
        flag.Parse()
@@ -123,16 +123,16 @@ func main() {
                        Verifier: verifier,
                        DSAPriv:  priv,
                },
-               Protocol: protocol,
-               InterfaceName: *ifaceName,
-               ProxyAddress: *proxyAddr,
+               Protocol:            protocol,
+               InterfaceName:       *ifaceName,
+               ProxyAddress:        *proxyAddr,
                ProxyAuthentication: *proxyAuth,
-               RemoteAddress: *remoteAddr,
-               UpPath: *upPath,
-               DownPath: *downPath,
-               StatsAddress: *stats,
-               NoReconnect: *noreconnect,
-               MTU: *mtu,
+               RemoteAddress:       *remoteAddr,
+               UpPath:              *upPath,
+               DownPath:            *downPath,
+               StatsAddress:        *stats,
+               NoReconnect:         *noreconnect,
+               MTU:                 *mtu,
        }
        if err = conf.Validate(); err != nil {
                log.Fatalln("Invalid settings:", err)