fix review comments

Signed-off-by: dhilipkumars <dhilip.kumar.s@huawei.com>
This commit is contained in:
dhilipkumars 2017-05-25 10:40:42 +05:30
parent 635b8986c2
commit 104e2f9db6
2 changed files with 4 additions and 6 deletions

View File

@ -55,13 +55,13 @@ func lookupFwMethod(fwMethod uint32) string {
}
func checkDestination(t *testing.T, i *Handle, s *Service, d *Destination, checkPresent bool) {
dstFound := false
var dstFound bool
dstArray, err := i.GetDestinations(s)
require.NoError(t, err)
for _, dst := range dstArray {
if dst.Address.String() == d.Address.String() && dst.Port == d.Port && lookupFwMethod(dst.ConnectionFlags) == lookupFwMethod(d.ConnectionFlags) {
if dst.Address.Equal(d.Address) && dst.Port == d.Port && lookupFwMethod(dst.ConnectionFlags) == lookupFwMethod(d.ConnectionFlags) {
dstFound = true
break
}
@ -86,7 +86,7 @@ func checkService(t *testing.T, i *Handle, s *Service, checkPresent bool) {
svcArray, err := i.GetServices()
require.NoError(t, err)
svcFound := false
var svcFound bool
for _, svc := range svcArray {

View File

@ -225,7 +225,6 @@ done:
return nil, err
}
for _, m := range msgs {
if m.Header.Seq != req.Seq {
continue
}
@ -235,7 +234,6 @@ done:
if m.Header.Type == syscall.NLMSG_DONE {
break done
}
if m.Header.Type == syscall.NLMSG_ERROR {
error := int32(native.Uint32(m.Data[0:4]))
if error == 0 {
@ -396,7 +394,7 @@ func (i *Handle) doGetServicesCmd(svc *Service) ([]*Service, error) {
for _, msg := range msgs {
srv, err := i.parseService(msg)
if err != nil {
return res, err
return nil, err
}
res = append(res, srv)
}