From 9ddcbb79148653a554a4d09c2a82ae4de4fee79f Mon Sep 17 00:00:00 2001 From: kaiyou Date: Sun, 10 May 2020 16:38:28 +0200 Subject: [PATCH] Apply suggestions from code review Review suggestions in the documentation Co-authored-by: Leo Antunes --- cluster/delegate.go | 12 ++++++------ wg/wireguard.go | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cluster/delegate.go b/cluster/delegate.go index 7c55577..3e73267 100644 --- a/cluster/delegate.go +++ b/cluster/delegate.go @@ -11,12 +11,12 @@ type delegateNode struct { *common.Node } -// NotifyConflict implements the memberlist deletage interface +// NotifyConflict implements the memberlist.Delegate interface func (n *delegateNode) NotifyConflict(node, other *memberlist.Node) { logrus.Errorf("node name conflict detected: %s", other.Name) } -// NodeMeta implements the memberlist deletage interface +// NodeMeta implements the memberlist.Delegate interface // Metadata is provided by the local node settings, encoding is handled // by the node implementation directly func (n *delegateNode) NodeMeta(limit int) []byte { @@ -28,14 +28,14 @@ func (n *delegateNode) NodeMeta(limit int) []byte { return encoded } -// NotifyMsg implements the memberlist deletage interface +// NotifyMsg implements the memberlist.Delegate interface func (n *delegateNode) NotifyMsg([]byte) {} -// GetBroadcasts implements the memberlist deletage interface +// GetBroadcasts implements the memberlist.Delegate interface func (n *delegateNode) GetBroadcasts(overhead, limit int) [][]byte { return nil } -// LocalState implements the memberlist deletage interface +// LocalState implements the memberlist.Delegate interface func (n *delegateNode) LocalState(join bool) []byte { return nil } -// MergeRemoteState implements the memberlist deletage interface +// MergeRemoteState implements the memberlist.Delegate interface func (n *delegateNode) MergeRemoteState(buf []byte, join bool) {} diff --git a/wg/wireguard.go b/wg/wireguard.go index 1e9ac37..733d36a 100644 --- a/wg/wireguard.go +++ b/wg/wireguard.go @@ -87,7 +87,7 @@ func (s *State) DownInterface() error { return netlink.LinkDel(link) } -// SetUpInterface creates and setup the associated network interface +// SetUpInterface creates and sets up the associated network interface func (s *State) SetUpInterface(nodes []common.Node) error { if err := netlink.LinkAdd(&wireguard{LinkAttrs: netlink.LinkAttrs{Name: s.iface}}); err != nil && !os.IsExist(err) { return errors.Wrapf(err, "could not create interface %s", s.iface)