Fixing golang linters for VGC
Change-Id: I386d232c74ab47e24d92c18800dc144120b920da
diff --git a/internal/pkg/of/flows.go b/internal/pkg/of/flows.go
index ff44754..aa43cfc 100644
--- a/internal/pkg/of/flows.go
+++ b/internal/pkg/of/flows.go
@@ -11,7 +11,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-*/
+ */
package of
@@ -22,8 +22,9 @@
"github.com/google/gopacket/layers"
- "github.com/opencord/voltha-lib-go/v7/pkg/flows"
"voltha-go-controller/log"
+
+ "github.com/opencord/voltha-lib-go/v7/pkg/flows"
ofp "github.com/opencord/voltha-protos/v5/go/openflow_13"
//"github.com/opencord/voltha-protos/v5/go/voltha"
)
@@ -175,25 +176,25 @@
// Match structure
type Match struct {
- InPort uint32
- MatchVlan VlanType
- SrcMacMatch bool
SrcMacAddr net.HardwareAddr
SrcMacMask net.HardwareAddr
- DstMacMatch bool
DstMacAddr net.HardwareAddr
DstMacMask net.HardwareAddr
- MatchPbits bool
+ SrcIpv4Addr net.IP
+ DstIpv4Addr net.IP
+ TableMetadata uint64
+ InPort uint32
+ MatchVlan VlanType
Pbits PbitType
L3Protocol EtherType
- SrcIpv4Match bool
- SrcIpv4Addr net.IP
- DstIpv4Match bool
- DstIpv4Addr net.IP
- L4Protocol IPProtocol
SrcPort uint16
DstPort uint16
- TableMetadata uint64
+ L4Protocol IPProtocol
+ DstIpv4Match bool
+ SrcIpv4Match bool
+ SrcMacMatch bool
+ DstMacMatch bool
+ MatchPbits bool
}
// Reset to be used when a Match is created. It sets the values to
@@ -327,16 +328,16 @@
// Action structure
type Action struct {
- Output OutputType
PushVlan []VlanType
- EtherType layers.EthernetType
- SetVlan VlanType
+ Metadata uint64
RemoveVlan int
OutPort uint32
GoToTableID uint32
- Metadata uint64
MeterID uint32
+ EtherType layers.EthernetType
+ SetVlan VlanType
Pcp PbitType
+ Output OutputType
}
const (
@@ -417,16 +418,16 @@
// VoltSubFlow structure
type VoltSubFlow struct {
- Cookie uint64
- CookieMask uint64
- // OldCookie is used in vgc upgrade when there is cookie generation logic change.
- OldCookie uint64
- TableID uint32
- Priority uint32
- State uint8
ErrorReason string
Match
Action
+ Cookie uint64
+ CookieMask uint64
+ // OldCookie is used in vgc upgrade when there is cookie generation logic change.
+ OldCookie uint64
+ TableID uint32
+ Priority uint32
+ State uint8
}
// NewVoltSubFlow is constructor for VoltSubFlow
@@ -454,13 +455,13 @@
// VoltFlow : Definition of a flow
type VoltFlow struct {
+ SubFlows map[uint64]*VoltSubFlow
+ // PortName and PortID to be used for validation of port before flow pushing
+ PortName string
+ PortID uint32
Command Command
- SubFlows map[uint64]*VoltSubFlow
ForceAction bool
MigrateCookie bool
- // PortName and PortID to be used for validation of port before flow pushing
- PortName string
- PortID uint32
}
const (
diff --git a/internal/pkg/of/group.go b/internal/pkg/of/group.go
index 14d73a7..cfa9b67 100644
--- a/internal/pkg/of/group.go
+++ b/internal/pkg/of/group.go
@@ -22,7 +22,7 @@
// "github.com/opencord/voltha-protos/v5/go/voltha"
)
-// The commands on groups avialable. Add is not expected to be used.
+// The commands on groups available. Add is not expected to be used.
// The mod is used for both create and update. The delete is used to
// delete the group
@@ -54,13 +54,13 @@
// Group structure
type Group struct {
Device string
- Command GroupCommand `json:"-"`
- GroupID uint32
- Buckets []uint32
- SetVlan VlanType
- IsPonVlanPresent bool
- State uint8
ErrorReason string
+ Buckets []uint32
+ GroupID uint32
+ SetVlan VlanType
+ Command GroupCommand `json:"-"`
+ State uint8
+ IsPonVlanPresent bool
ForceAction bool
}
diff --git a/internal/pkg/of/meter.go b/internal/pkg/of/meter.go
index 625b1a7..25bf601 100644
--- a/internal/pkg/of/meter.go
+++ b/internal/pkg/of/meter.go
@@ -11,7 +11,7 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-*/
+ */
package of
@@ -49,10 +49,10 @@
// Meter structure
type Meter struct {
- ID uint32
- Bands []Band
- State uint8
ErrorReason string
+ Bands []Band
+ ID uint32
+ State uint8
}
// NewMeter is constructor for Meter