From 9e6f602e9836c3f7b92b9112c06cf5f72882be2b Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Sun, 26 Jan 2025 11:43:55 +0900 Subject: [PATCH] gh-829 fixed typos and golint warns --- pkg/loxinet/cluster.go | 2 +- pkg/loxinet/layer2.go | 2 +- pkg/loxinet/layer3.go | 2 +- pkg/loxinet/mirror.go | 2 +- pkg/loxinet/neighbor.go | 2 +- pkg/loxinet/qospol.go | 2 +- pkg/loxinet/utils_cloud.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/loxinet/cluster.go b/pkg/loxinet/cluster.go index facbda0e..4ad54c31 100644 --- a/pkg/loxinet/cluster.go +++ b/pkg/loxinet/cluster.go @@ -93,7 +93,7 @@ type CIStateH struct { initRules6 bool } -func (ci *CIStateH) BFDSessionNotify(instance string, remote string, ciState string) { +func (ci *CIStateH) BFDSessionNotify(instance string, _ string, ciState string) { var sm cmn.HASMod sm.Instance = instance diff --git a/pkg/loxinet/layer2.go b/pkg/loxinet/layer2.go index 5370e8ce..c2a40de3 100644 --- a/pkg/loxinet/layer2.go +++ b/pkg/loxinet/layer2.go @@ -357,7 +357,7 @@ func (l2 *L2H) FdbsTicker() { } // PortNotifier - Implementation of PortEventIntf interface -func (l2 *L2H) PortNotifier(name string, osID int, evType PortEvent) { +func (l2 *L2H) PortNotifier(name string, _ int, evType PortEvent) { if evType&PortEvDown|PortEvDelete|PortEvLowerDown != 0 { for _, f := range l2.FdbMap { if f.FdbAttr.Oif == name { diff --git a/pkg/loxinet/layer3.go b/pkg/loxinet/layer3.go index 69df1539..9417369c 100644 --- a/pkg/loxinet/layer3.go +++ b/pkg/loxinet/layer3.go @@ -110,7 +110,7 @@ func (l3 *L3H) IfaAdd(Obj string, Cidr string) (int, error) { ra := RtAttr{0, 0, false, ifObjID, false} _, err = mh.zr.Rt.RtAdd(*network, RootZone, ra, nil) if err != nil { - tk.LogIt(tk.LogDebug, "ifa add - %s:%s subnet-rt error\n", addr.String(), Obj) + tk.LogIt(tk.LogTrace, "ifa add - %s:%s subnet-rt error\n", addr.String(), Obj) return L3AddrErr, errors.New("subnet-route add error") } else if sz, _ := net.IPMask(network.Mask).Size(); sz != 32 && sz != 128 { myAddr, myNet, err := net.ParseCIDR(addr.String() + "/32") diff --git a/pkg/loxinet/mirror.go b/pkg/loxinet/mirror.go index b3d13e6c..a9c3d020 100644 --- a/pkg/loxinet/mirror.go +++ b/pkg/loxinet/mirror.go @@ -214,7 +214,7 @@ func (M *MirrH) MirrDelete(name string) (int, error) { } for idx, mObj := range m.MObjs { - var pM *MirrObjInfo = &m.MObjs[idx] + pM := &m.MObjs[idx] mObj.MirrObj2DP(DpRemove) pM.Parent = nil } diff --git a/pkg/loxinet/neighbor.go b/pkg/loxinet/neighbor.go index e7f59957..64caa2e6 100644 --- a/pkg/loxinet/neighbor.go +++ b/pkg/loxinet/neighbor.go @@ -142,7 +142,7 @@ func (n *NeighH) Activate(ne *Neigh) { name := ne.OifPort.Name addr := ne.Addr var Sip net.IP - ret := -1 + var ret int if ne.OifPort.IsIPinIPTunPort() { addr = ne.OifPort.HInfo.TunDst ret, Sip, name = n.Zone.L3.IfaSelectAny(addr, false) diff --git a/pkg/loxinet/qospol.go b/pkg/loxinet/qospol.go index 48262f4a..f27151c7 100644 --- a/pkg/loxinet/qospol.go +++ b/pkg/loxinet/qospol.go @@ -213,7 +213,7 @@ func (P *PolH) PolDelete(pName string) (int, error) { } for idx, pObj := range p.PObjs { - var pP *PolObjInfo = &p.PObjs[idx] + pP := &p.PObjs[idx] pObj.PolObj2DP(DpRemove) pP.Parent = nil } diff --git a/pkg/loxinet/utils_cloud.go b/pkg/loxinet/utils_cloud.go index 0bf32ac0..92a5e542 100644 --- a/pkg/loxinet/utils_cloud.go +++ b/pkg/loxinet/utils_cloud.go @@ -29,7 +29,7 @@ type CloudHookInterface interface { CloudUpdatePrivateIP(vIP net.IP, eIP net.IP, add bool) error } -func CloudHookNew(cloudLabel string) CloudHookInterface { +func CloudHookNew(_ string) CloudHookInterface { if mh.cloudLabel == "aws" { return AWSCloudHookNew() }