diff --git a/router/router.go b/router/router.go index 289307a6..89056f90 100644 --- a/router/router.go +++ b/router/router.go @@ -31,7 +31,7 @@ type Router struct { ConnLimit int BufSz int LogFrame func(string, []byte, *layers.Ethernet) - Port int + Port int } type PacketSource interface { @@ -422,9 +422,9 @@ func (router *Router) applyTopologyUpdate(update []byte) (PeerNameSet, PeerNameS // given an address like '1.2.3.4:567', return the address if it has a port, // otherwise return the address with the default port number for the router func (router *Router) NormalisePeerAddr(peerAddr string) string { - _, _, err := net.SplitHostPort(peerAddr) - if err == nil { - return peerAddr - } - return fmt.Sprintf("%s:%d", peerAddr, router.Port) + _, _, err := net.SplitHostPort(peerAddr) + if err == nil { + return peerAddr + } + return fmt.Sprintf("%s:%d", peerAddr, router.Port) } diff --git a/weaver/main.go b/weaver/main.go index dbcb8f66..9f6c11e3 100644 --- a/weaver/main.go +++ b/weaver/main.go @@ -203,7 +203,7 @@ func handleHTTP(router *weave.Router, httpAddr string) { protocol := "tcp" if strings.HasPrefix(httpAddr, "/") { - os.Remove(httpAddr); // in case it's there from last time + os.Remove(httpAddr) // in case it's there from last time protocol = "unix" } l, err := net.Listen(protocol, httpAddr)