[VOL-3285] Resolving statis code analysis warnings
Change-Id: Iaddaae92c649fd27ce0a63f1786af594667c9e8e
diff --git a/internal/bbr/devices/olt.go b/internal/bbr/devices/olt.go
index bd35f68..01aa411 100644
--- a/internal/bbr/devices/olt.go
+++ b/internal/bbr/devices/olt.go
@@ -20,6 +20,10 @@
"context"
"errors"
"fmt"
+ "io"
+ "reflect"
+ "time"
+
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/opencord/bbsim/internal/bbsim/devices"
@@ -28,9 +32,6 @@
"github.com/opencord/voltha-protos/v2/go/openolt"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
- "io"
- "reflect"
- "time"
)
type OltMock struct {
@@ -238,7 +239,7 @@
}()
for message := range onu.DoneChannel {
- if message == true {
+ if message {
o.CompletedOnus++
if o.CompletedOnus == o.TargetOnus {
// NOTE once all the ONUs are completed, exit
@@ -317,7 +318,6 @@
"pktType": pktType,
}).Trace("Received PktIndication")
- msg := devices.Message{}
if pktIndication.IntfType == "nni" {
// This is an packet that is arriving from the NNI and needs to be sent to an ONU
// in this case we need to fin the ONU from the C/S tags
@@ -335,7 +335,7 @@
}).Fatalf("Can't find ONU from c/s tags")
}
- msg = devices.Message{
+ msg := devices.Message{
Type: devices.OnuPacketIn,
Data: devices.OnuPacketMessage{
IntfId: pktIndication.IntfId,
@@ -367,7 +367,7 @@
}
// NOTE when we push the EAPOL flow we set the PortNo = OnuId for convenience sake
// BBsim responds setting the port number that was sent with the flow
- msg = devices.Message{
+ msg := devices.Message{
Type: devices.OnuPacketIn,
Data: devices.OnuPacketMessage{
IntfId: pktIndication.IntfId,
diff --git a/internal/bbr/devices/validate.go b/internal/bbr/devices/validate.go
index cb2551f..e6d9594 100644
--- a/internal/bbr/devices/validate.go
+++ b/internal/bbr/devices/validate.go
@@ -19,10 +19,11 @@
import (
"context"
"fmt"
+ "time"
+
"github.com/opencord/bbsim/api/bbsim"
log "github.com/sirupsen/logrus"
"google.golang.org/grpc"
- "time"
)
func ValidateAndClose(olt *OltMock) {
@@ -57,7 +58,7 @@
}
}
- if res == true {
+ if res {
log.WithFields(log.Fields{
"ExpectedState": expectedState,
}).Infof("%d ONUs matching expected state", len(onus.Items))