Skip to content

Commit f88932c

Browse files
committed
fixed golint errors
1 parent 06eb949 commit f88932c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

cns/middlewares/k8sSwiftV2_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (k *K8sSWIFTv2Middleware) addDefaultRoute(podIPInfo *cns.PodIpInfo, gwIP st
6363
}
6464

6565
// get policy of type endpoint policy given the params
66-
func getEndpointPolicyL(policyType string, action string, direction string, priority int) (policy.Policy, error) {
66+
func getEndpointPolicyL(policyType, action, direction string, priority int) (policy.Policy, error) {
6767
endpointPolicy, err := createEndpointPolicy(policyType, action, direction, priority)
6868
if err != nil {
6969
return policy.Policy{}, errors.Wrap(err, "failed to create endpoint policy")
@@ -86,14 +86,14 @@ func createEndpointPolicy(policyType string, action string, direction string, pr
8686
Priority int `json:"Priority"`
8787
}
8888

89-
policy := EndpointPolicy{
89+
endpointPolicy := EndpointPolicy{
9090
Type: policyType,
9191
Action: action,
9292
Direction: direction,
9393
Priority: priority,
9494
}
9595

96-
rawPolicy, err := json.Marshal(policy)
96+
rawPolicy, err := json.Marshal(endpointPolicy)
9797
if err != nil {
9898
return nil, errors.Wrap(err, "error marshalling policy to json")
9999
}

cns/middlewares/k8sSwiftV2_windows_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,10 @@ func TestAddDefaultDenyACL(t *testing.T) {
147147
},
148148
}
149149
var allEndpoints []policy.Policy
150-
151-
defaultDenyEngressPolicy, err := getEndpointPolicyL("ACL", "Block", "Out", 10000)
152-
defaultDenyIngressPolicy, err := getEndpointPolicyL("ACL", "Block", "In", 10000)
150+
var defaultDenyEngressPolicy, defaultDenyIngressPolicy policy.Policy
151+
var err error
152+
defaultDenyEngressPolicy, err = getEndpointPolicyL("ACL", "Block", "Out", 10000)
153+
defaultDenyIngressPolicy, err = getEndpointPolicyL("ACL", "Block", "In", 10000)
153154

154155
allEndpoints = append(allEndpoints, defaultDenyEngressPolicy, defaultDenyIngressPolicy)
155156
assert.Equal(t, err, nil)

0 commit comments

Comments
 (0)