Apply suggestions from code review

Review suggestions in the documentation

Co-authored-by: Leo Antunes <leo@costela.net>
This commit is contained in:
kaiyou 2020-05-10 16:38:28 +02:00 committed by Leo Antunes
parent faf1c35d96
commit 9ddcbb7914
2 changed files with 7 additions and 7 deletions

View File

@ -11,12 +11,12 @@ type delegateNode struct {
*common.Node *common.Node
} }
// NotifyConflict implements the memberlist deletage interface // NotifyConflict implements the memberlist.Delegate interface
func (n *delegateNode) NotifyConflict(node, other *memberlist.Node) { func (n *delegateNode) NotifyConflict(node, other *memberlist.Node) {
logrus.Errorf("node name conflict detected: %s", other.Name) 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 // Metadata is provided by the local node settings, encoding is handled
// by the node implementation directly // by the node implementation directly
func (n *delegateNode) NodeMeta(limit int) []byte { func (n *delegateNode) NodeMeta(limit int) []byte {
@ -28,14 +28,14 @@ func (n *delegateNode) NodeMeta(limit int) []byte {
return encoded return encoded
} }
// NotifyMsg implements the memberlist deletage interface // NotifyMsg implements the memberlist.Delegate interface
func (n *delegateNode) NotifyMsg([]byte) {} 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 } 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 } 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) {} func (n *delegateNode) MergeRemoteState(buf []byte, join bool) {}

View File

@ -87,7 +87,7 @@ func (s *State) DownInterface() error {
return netlink.LinkDel(link) 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 { func (s *State) SetUpInterface(nodes []common.Node) error {
if err := netlink.LinkAdd(&wireguard{LinkAttrs: netlink.LinkAttrs{Name: s.iface}}); err != nil && !os.IsExist(err) { 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) return errors.Wrapf(err, "could not create interface %s", s.iface)