From 2cc402237e458feea914d009fdc9e1db1e9eced6 Mon Sep 17 00:00:00 2001 From: vadym Date: Tue, 13 Dec 2022 23:05:19 +0200 Subject: [PATCH] go code autoformat --- src/admin/getdht.go | 1 - src/admin/getpaths.go | 1 - src/admin/getpeers.go | 1 - src/admin/getsessions.go | 1 - src/core/link_tcp.go | 1 - src/core/proto.go | 1 - src/multicast/multicast_darwin.go | 1 - src/multicast/multicast_unix.go | 8 ++++---- src/tun/tun.go | 4 ++-- src/tun/tun_windows.go | 4 ++-- 10 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/admin/getdht.go b/src/admin/getdht.go index 71248a2f..bf9e97bb 100644 --- a/src/admin/getdht.go +++ b/src/admin/getdht.go @@ -5,7 +5,6 @@ import ( "net" "sort" "strings" - //"github.com/RiV-chain/RiV-mesh/src/address" ) diff --git a/src/admin/getpaths.go b/src/admin/getpaths.go index 45760db5..fe845685 100644 --- a/src/admin/getpaths.go +++ b/src/admin/getpaths.go @@ -5,7 +5,6 @@ import ( "net" "sort" "strings" - //"github.com/RiV-chain/RiV-mesh/src/address" ) diff --git a/src/admin/getpeers.go b/src/admin/getpeers.go index fc2426e4..6c8691c8 100644 --- a/src/admin/getpeers.go +++ b/src/admin/getpeers.go @@ -4,7 +4,6 @@ import ( "encoding/hex" "net" "sort" - //"github.com/RiV-chain/RiV-mesh/src/address" ) diff --git a/src/admin/getsessions.go b/src/admin/getsessions.go index a5ae0d1b..07babca5 100644 --- a/src/admin/getsessions.go +++ b/src/admin/getsessions.go @@ -5,7 +5,6 @@ import ( "net" "sort" "strings" - //"github.com/RiV-chain/RiV-mesh/src/address" ) diff --git a/src/core/link_tcp.go b/src/core/link_tcp.go index 74f72e00..714ea9d9 100644 --- a/src/core/link_tcp.go +++ b/src/core/link_tcp.go @@ -186,7 +186,6 @@ func (l *linkTCP) dialerFor(dst *net.TCPAddr, sintf string) (*net.Dialer, error) return dialer, nil } - func tcpIDFor(local net.Addr, remoteAddr *net.TCPAddr) string { if localAddr, ok := local.(*net.TCPAddr); ok && localAddr.IP.Equal(remoteAddr.IP) { // Nodes running on the same host — include both the IP and port. diff --git a/src/core/proto.go b/src/core/proto.go index 76ad4b25..5694c339 100644 --- a/src/core/proto.go +++ b/src/core/proto.go @@ -11,7 +11,6 @@ import ( iwt "github.com/Arceliar/ironwood/types" "github.com/Arceliar/phony" - //"github.com/RiV-chain/RiV-mesh/src/address" ) diff --git a/src/multicast/multicast_darwin.go b/src/multicast/multicast_darwin.go index 7c2579d4..22cf3998 100644 --- a/src/multicast/multicast_darwin.go +++ b/src/multicast/multicast_darwin.go @@ -4,7 +4,6 @@ package multicast - import ( "syscall" diff --git a/src/multicast/multicast_unix.go b/src/multicast/multicast_unix.go index 60477740..4247d7d1 100644 --- a/src/multicast/multicast_unix.go +++ b/src/multicast/multicast_unix.go @@ -20,10 +20,10 @@ func (m *Multicast) multicastReuse(network string, address string, c syscall.Raw var reuseaddr error control = c.Control(func(fd uintptr) { - // Previously we used SO_REUSEPORT here, but that meant that machines running - // RiV-mesh nodes as different users would inevitably fail with EADDRINUSE. - // The behaviour for multicast is similar with both, so we'll use SO_REUSEADDR - // instead. + // Previously we used SO_REUSEPORT here, but that meant that machines running + // RiV-mesh nodes as different users would inevitably fail with EADDRINUSE. + // The behaviour for multicast is similar with both, so we'll use SO_REUSEADDR + // instead. if reuseaddr = unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_REUSEADDR, 1); reuseaddr != nil { fmt.Fprintf(os.Stderr, "Failed to set SO_REUSEADDR on socket: %s\n", reuseaddr) } diff --git a/src/tun/tun.go b/src/tun/tun.go index dc572b6e..92451e0d 100644 --- a/src/tun/tun.go +++ b/src/tun/tun.go @@ -94,8 +94,8 @@ func MaximumMTU() uint64 { func New(core *core.Core, log core.Logger, opts ...SetupOption) (*TunAdapter, error) { tun := &TunAdapter{ core: core, - rwc: ipv6rwc.NewReadWriteCloser(core), - log: log, + rwc: ipv6rwc.NewReadWriteCloser(core), + log: log, } for _, opt := range opts { tun._applyOption(opt) diff --git a/src/tun/tun_windows.go b/src/tun/tun_windows.go index 11726375..7ffa8721 100644 --- a/src/tun/tun_windows.go +++ b/src/tun/tun_windows.go @@ -6,9 +6,9 @@ package tun import ( "bytes" "errors" - "time" "log" "net" + "time" "github.com/RiV-chain/RiV-mesh/src/defaults" "golang.org/x/sys/windows" @@ -43,7 +43,7 @@ func (tun *TunAdapter) setup(ifname string, addr string, mtu uint64) error { if i > 8 { return err } else { - time.Sleep(time.Duration(2 * i) * time.Second) + time.Sleep(time.Duration(2*i) * time.Second) } } else { break