Fixing golang linters for VGC
Change-Id: I386d232c74ab47e24d92c18800dc144120b920da
diff --git a/internal/pkg/application/meters.go b/internal/pkg/application/meters.go
index 276fe99..2592be5 100644
--- a/internal/pkg/application/meters.go
+++ b/internal/pkg/application/meters.go
@@ -16,13 +16,13 @@
package application
import (
+ "context"
"encoding/json"
"errors"
- "context"
"sync"
- cntlr "voltha-go-controller/internal/pkg/controller"
"voltha-go-controller/database"
+ cntlr "voltha-go-controller/internal/pkg/controller"
"voltha-go-controller/internal/pkg/of"
"voltha-go-controller/log"
)
@@ -72,13 +72,13 @@
// The ID is generated by the VOLT application
type VoltMeter struct {
Name string
+ Version string
ID uint32
Fir uint32
Air uint32
Eir uint32
BurstSize uint32
AssociatedServices uint32
- Version string
Cir uint32
Cbs uint32
Pir uint32
@@ -162,7 +162,7 @@
vm.Air = 0
}
- //Set Pir & Pbs
+ // Set Pir & Pbs
var pir uint32
var pbs uint32
if vm.Pir != 0 {
@@ -186,7 +186,7 @@
logger.Infow(ctx, "Meter Config", log.Fields{"Cir": vm.Cir, "Air": vm.Air, "Pir": vm.Pir, "Gir": vm.Gir, "Eir": vm.Eir})
logger.Infow(ctx, "Meter Burst Config", log.Fields{"Cbs": vm.Cbs, "Pbs": vm.Pbs})
logger.Infow(ctx, "Meter Burst Oper", log.Fields{"Pir": pir, "Pbs": pbs})
- //Set Air
+ // Set Air
// Air is used in place of Gir only if Gir is
// not present and Air is not 0
if vm.Air != 0 {
@@ -243,7 +243,6 @@
// AddMeterProf to add the meter profile name as key
func (va *VoltApplication) AddMeterProf(cntx context.Context, cfg VoltMeter) {
-
mm := &va.MeterMgr
if _, ok := mm.GetMeterByName(cfg.Name); ok {
logger.Warnw(ctx, "Meter profile exists", log.Fields{"Name": cfg.Name})
@@ -251,8 +250,8 @@
}
mm.LastMeterID++
- //FIX-ME: Hardcoded the meter-id temp till meter delete is introduced
- //Restriction: Only one meter profile should be used across all services
+ // FIX-ME: Hardcoded the meter-id temp till meter delete is introduced
+ // Restriction: Only one meter profile should be used across all services
// id := uint32(1) //mm.LastMeterId
id := mm.LastMeterID
cfg.ID = id
@@ -295,7 +294,6 @@
// DeleteFromDevice to delete meter from the device
func (vm *VoltMeter) DeleteFromDevice(port string, device string) {
-
meter := of.NewMeter(vm.ID)
logger.Debugw(ctx, "Delete meter from device", log.Fields{"Id": vm.ID, "meter": *meter})
@@ -317,7 +315,7 @@
log.Fields{"MeterProfile": name, "serviceCount": cfg.AssociatedServices})
return errors.New("Service reference is not 0")
}
- //TODO : delete from all devices
+ // TODO : delete from all devices
delmeterFromDevice := func(key interface{}, value interface{}) bool {
device := key.(string)
port, _ := GetApplication().GetNniPort(device)
@@ -326,7 +324,7 @@
}
va.DevicesDisc.Range(delmeterFromDevice)
cfg.DelFromDb(cntx)
- //Delete meter from device will be invoked by caller separately
+ // Delete meter from device will be invoked by caller separately
mm.DelMeter(cfg)
return nil
}