Skip to content

Commit 419dace

Browse files
committed
address linter issues
1 parent bfd9e79 commit 419dace

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

network/endpoint_linux.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ func (nw *network) deleteEndpointImpl(nl netlink.NetlinkInterface, plc platform.
279279
epInfo := ep.getInfo()
280280
if nw.Mode == opModeTransparentVlan {
281281
epClient = NewTransparentVlanEndpointClient(nw, epInfo, ep.HostIfName, "", ep.VlanID, ep.LocalIP, nl, plc, nsc, iptc)
282-
283282
} else {
284283
epClient = NewOVSEndpointClient(nw, epInfo, ep.HostIfName, "", ep.VlanID, ep.LocalIP, nl, ovsctl.NewOvsctl(), plc, iptc)
285284
}

network/manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ func (nm *networkManager) UpdateEndpointState(eps []*endpoint) error {
439439
logger.Info("Update endpoint API returend ", zap.String("podname: ", response.ReturnCode.String()))
440440
return nil
441441
}
442+
442443
func validateUpdateEndpointState(endpointID string, ifNameToIPInfoMap map[string]*restserver.IPInfo) error {
443444
if endpointID == "" {
444445
return errors.New("endpoint id empty while validating update endpoint state")

network/snat/snat_linux_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@ import (
1010

1111
var anyInterface = "dummy"
1212

13-
type mockIPTablesClient struct {
14-
}
13+
type mockIPTablesClient struct{}
1514

16-
func (c mockIPTablesClient) InsertIptableRule(version, tableName, chainName, match, target string) error {
15+
func (c mockIPTablesClient) InsertIptableRule(_, _, _, _, _ string) error {
1716
return nil
1817
}
19-
func (c mockIPTablesClient) AppendIptableRule(version, tableName, chainName, match, target string) error {
18+
19+
func (c mockIPTablesClient) AppendIptableRule(_, _, _, _, _ string) error {
2020
return nil
2121
}
22-
func (c mockIPTablesClient) DeleteIptableRule(version, tableName, chainName, match, target string) error {
22+
23+
func (c mockIPTablesClient) DeleteIptableRule(_, _, _, _, _ string) error {
2324
return nil
2425
}
25-
func (c mockIPTablesClient) CreateChain(version, tableName, chainName string) error {
26+
27+
func (c mockIPTablesClient) CreateChain(_, _, _ string) error {
2628
return nil
2729
}
2830

network/transparent_vlan_endpointclient_linux_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ import (
1515
"github.com/stretchr/testify/require"
1616
)
1717

18-
var errNetnsMock = errors.New("mock netns error")
19-
var errMockNetIOFail = errors.New("netio fail")
20-
var errMockNetIONoIfFail = &net.OpError{Op: "route", Net: "ip+net", Source: nil, Addr: nil, Err: errors.New("no such network interface")}
18+
var (
19+
errNetnsMock = errors.New("mock netns error")
20+
errMockNetIOFail = errors.New("netio fail")
21+
errMockNetIONoIfFail = &net.OpError{Op: "route", Net: "ip+net", Source: nil, Addr: nil, Err: errors.New("no such network interface")}
22+
)
2123

2224
func newNetnsErrorMock(errStr string) error {
2325
return errors.Wrap(errNetnsMock, errStr)

0 commit comments

Comments
 (0)