linter fixes
This commit is contained in:
parent
4bf887e75f
commit
df5babf6c8
15 changed files with 49 additions and 55 deletions
|
|
@ -27,7 +27,7 @@ func DefaultInterface() (iface string, err error) {
|
|||
}
|
||||
|
||||
type Network struct {
|
||||
sync.Mutex
|
||||
mu sync.Mutex
|
||||
m map[string]struct{}
|
||||
iface string
|
||||
label string
|
||||
|
|
@ -76,8 +76,8 @@ func (n *Network) HasIP(a *netlink.Addr) bool {
|
|||
}
|
||||
|
||||
func (n *Network) AddIP(cidr string) error {
|
||||
n.Lock()
|
||||
defer n.Unlock()
|
||||
n.mu.Lock()
|
||||
defer n.mu.Unlock()
|
||||
addr, err := netlink.ParseAddr(cidr)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -97,8 +97,8 @@ func (n *Network) AddIP(cidr string) error {
|
|||
}
|
||||
|
||||
func (n *Network) DeleteIP(cidr string) error {
|
||||
n.Lock()
|
||||
defer n.Unlock()
|
||||
n.mu.Lock()
|
||||
defer n.mu.Unlock()
|
||||
addr, err := netlink.ParseAddr(cidr)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -115,8 +115,8 @@ func (n *Network) DeleteIP(cidr string) error {
|
|||
}
|
||||
|
||||
func (n *Network) GetIPs() (cidrs []string) {
|
||||
n.Lock()
|
||||
defer n.Unlock()
|
||||
n.mu.Lock()
|
||||
defer n.mu.Unlock()
|
||||
cidrs = make([]string, len(n.m))
|
||||
c := 0
|
||||
for k := range n.m {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue