[VOL-5026] - Build and (pre-) deploy repo:voltha-go

Makefile
--------
  o Refactor test and mod-* targets per voltha-openolt-adatpter/Makefile.
  o Logic moved into makefiles/analysis/{coverage,sca}.mk
  o Inline ( set -euo pipefail && cmd | tee log) in test-coverage.
  o Improve error handling, "cmd | tee" will silently mask shell exit status.
  o make test failing locally (docker image: cpu profile acces denied).
  o Local problem, send a job through jenkins for accurate status.

makefiles/
----------
  o Copy in library makefiles
  o Esp docker/include.mk

compose/*/*.yaml
----------------
  o Update copyright notice

db/*/*.go
rw_core/*/*.go
--------------
  o Run gofmt -s -w on source to fix latent linting problmes that fail jobs.

Change-Id: If7cd349822edd0e604ac4daf27d315f528c6bcf6
diff --git a/rw_core/core/device/agent.go b/rw_core/core/device/agent.go
index d6430af..bc3eaed 100755
--- a/rw_core/core/device/agent.go
+++ b/rw_core/core/device/agent.go
@@ -85,7 +85,7 @@
 	transientStateLoader *transientstate.Loader
 }
 
-//newAgent creates a new device agent. The device will be initialized when start() is called.
+// newAgent creates a new device agent. The device will be initialized when start() is called.
 func newAgent(device *voltha.Device, deviceMgr *Manager, dbPath *model.Path, deviceProxy *model.Proxy, internalTimeout, rpcTimeout, flowTimeout time.Duration) *Agent {
 	deviceID := device.Id
 	if deviceID == "" {
@@ -319,7 +319,8 @@
 }
 
 // onDeleteFailure is a common callback for scenarios where we receive an error response following a delete request
-//  to an adapter and the only action required is to return the error response.
+//
+//	to an adapter and the only action required is to return the error response.
 func (agent *Agent) onDeleteFailure(ctx context.Context, err error, prevState, currState *common.AdminState_Types) {
 	logger.Errorw(ctx, "rpc-failed", log.Fields{"rpc": coreutils.GetRPCMetadataFromContext(ctx), "device-id": agent.deviceID, "error": err})
 
@@ -483,8 +484,8 @@
 	return nil
 }
 
-//addFlowsAndGroups adds the "newFlows" and "newGroups" from the existing flows/groups and sends the update to the
-//adapters
+// addFlowsAndGroups adds the "newFlows" and "newGroups" from the existing flows/groups and sends the update to the
+// adapters
 func (agent *Agent) addFlowsAndGroups(ctx context.Context, newFlows []*ofp.OfpFlowStats, newGroups []*ofp.OfpGroupEntry, flowMetadata *ofp.FlowMetadata) error {
 	var flwResponse, grpResponse coreutils.Response
 	var err error
@@ -503,8 +504,8 @@
 	return nil
 }
 
-//deleteFlowsAndGroups removes the "flowsToDel" and "groupsToDel" from the existing flows/groups and sends the update to the
-//adapters
+// deleteFlowsAndGroups removes the "flowsToDel" and "groupsToDel" from the existing flows/groups and sends the update to the
+// adapters
 func (agent *Agent) deleteFlowsAndGroups(ctx context.Context, flowsToDel []*ofp.OfpFlowStats, groupsToDel []*ofp.OfpGroupEntry, flowMetadata *ofp.FlowMetadata) error {
 	var flwResponse, grpResponse coreutils.Response
 	var err error
@@ -521,8 +522,8 @@
 	return nil
 }
 
-//updateFlowsAndGroups replaces the existing flows and groups with "updatedFlows" and "updatedGroups" respectively. It
-//also sends the updates to the adapters
+// updateFlowsAndGroups replaces the existing flows and groups with "updatedFlows" and "updatedGroups" respectively. It
+// also sends the updates to the adapters
 func (agent *Agent) updateFlowsAndGroups(ctx context.Context, updatedFlows []*ofp.OfpFlowStats, updatedGroups []*ofp.OfpGroupEntry, flowMetadata *ofp.FlowMetadata) error {
 	var flwResponse, grpResponse coreutils.Response
 	var err error
@@ -539,7 +540,7 @@
 	return nil
 }
 
-//disableDevice disable a device
+// disableDevice disable a device
 func (agent *Agent) disableDevice(ctx context.Context) error {
 	var err error
 	var desc string
diff --git a/rw_core/core/device/agent_flow.go b/rw_core/core/device/agent_flow.go
index 85c92f1..21fdef0 100644
--- a/rw_core/core/device/agent_flow.go
+++ b/rw_core/core/device/agent_flow.go
@@ -377,7 +377,7 @@
 	return response, nil
 }
 
-//filterOutFlows removes flows from a device using the uni-port as filter
+// filterOutFlows removes flows from a device using the uni-port as filter
 func (agent *Agent) filterOutFlows(ctx context.Context, uniPort uint32, flowMetadata *ofp.FlowMetadata) error {
 	var flowsToDelete []*ofp.OfpFlowStats
 	// If an existing flow has the uniPort as an InPort or OutPort or as a Tunnel ID then it needs to be removed
@@ -406,7 +406,7 @@
 	return nil
 }
 
-//deleteAllFlows deletes all flows in the device table
+// deleteAllFlows deletes all flows in the device table
 func (agent *Agent) deleteAllFlows(ctx context.Context) error {
 	logger.Debugw(ctx, "deleteAllFlows", log.Fields{"device-id": agent.deviceID})
 
diff --git a/rw_core/core/device/flow/cache.go b/rw_core/core/device/flow/cache.go
index c600c21..25f0244 100644
--- a/rw_core/core/device/flow/cache.go
+++ b/rw_core/core/device/flow/cache.go
@@ -135,7 +135,8 @@
 
 // ListIDs returns a snapshot of all the managed flow IDs
 // TODO: iterating through flows safely is expensive now, since all flows are stored & locked separately
-//       should avoid this where possible
+//
+//	should avoid this where possible
 func (cache *Cache) ListIDs() map[uint64]struct{} {
 	cache.lock.RLock()
 	defer cache.lock.RUnlock()
diff --git a/rw_core/core/device/group/cache.go b/rw_core/core/device/group/cache.go
index 49686ca..eb568cf 100644
--- a/rw_core/core/device/group/cache.go
+++ b/rw_core/core/device/group/cache.go
@@ -135,7 +135,8 @@
 
 // ListIDs returns a snapshot of all the managed group IDs
 // TODO: iterating through groups safely is expensive now, since all groups are stored & locked separately
-//       should avoid this where possible
+//
+//	should avoid this where possible
 func (cache *Cache) ListIDs() map[uint32]struct{} {
 	cache.lock.RLock()
 	defer cache.lock.RUnlock()
diff --git a/rw_core/core/device/logical_agent_flow.go b/rw_core/core/device/logical_agent_flow.go
index 4fa0090..7ec3b43 100644
--- a/rw_core/core/device/logical_agent_flow.go
+++ b/rw_core/core/device/logical_agent_flow.go
@@ -48,7 +48,7 @@
 	return flows
 }
 
-//updateFlowTable updates the flow table of that logical device
+// updateFlowTable updates the flow table of that logical device
 func (agent *LogicalAgent) updateFlowTable(ctx context.Context, flow *ofp.FlowTableUpdate) error {
 	logger.Debug(ctx, "update-flow-table")
 	if flow == nil {
@@ -71,7 +71,7 @@
 		"unhandled-command: lDeviceId:%s, command:%s", agent.logicalDeviceID, flow.FlowMod.GetCommand())
 }
 
-//flowAdd adds a flow to the flow table of that logical device
+// flowAdd adds a flow to the flow table of that logical device
 func (agent *LogicalAgent) flowAdd(ctx context.Context, flowUpdate *ofp.FlowTableUpdate) error {
 	mod := flowUpdate.FlowMod
 	logger.Debugw(ctx, "flow-add", log.Fields{"flow": mod})
@@ -271,7 +271,7 @@
 	return nil
 }
 
-//flowDelete deletes a flow from the flow table of that logical device
+// flowDelete deletes a flow from the flow table of that logical device
 func (agent *LogicalAgent) flowDelete(ctx context.Context, flowUpdate *ofp.FlowTableUpdate) error {
 	logger.Debug(ctx, "flow-delete")
 	mod := flowUpdate.FlowMod
@@ -406,7 +406,7 @@
 	return nil
 }
 
-//flowDeleteStrict deletes a flow from the flow table of that logical device
+// flowDeleteStrict deletes a flow from the flow table of that logical device
 func (agent *LogicalAgent) flowDeleteStrict(ctx context.Context, flowUpdate *ofp.FlowTableUpdate) error {
 	var flowHandle *flow.Handle
 	var have bool
@@ -528,12 +528,12 @@
 	return nil
 }
 
-//flowModify modifies a flow from the flow table of that logical device
+// flowModify modifies a flow from the flow table of that logical device
 func (agent *LogicalAgent) flowModify(flowUpdate *ofp.FlowTableUpdate) error {
 	return errors.New("flowModify not implemented")
 }
 
-//flowModifyStrict deletes a flow from the flow table of that logical device
+// flowModifyStrict deletes a flow from the flow table of that logical device
 func (agent *LogicalAgent) flowModifyStrict(flowUpdate *ofp.FlowTableUpdate) error {
 	return errors.New("flowModifyStrict not implemented")
 }
diff --git a/rw_core/core/device/logical_agent_group.go b/rw_core/core/device/logical_agent_group.go
index 261b0a5..2c855de 100644
--- a/rw_core/core/device/logical_agent_group.go
+++ b/rw_core/core/device/logical_agent_group.go
@@ -43,7 +43,7 @@
 	return groups
 }
 
-//updateGroupTable updates the group table of that logical device
+// updateGroupTable updates the group table of that logical device
 func (agent *LogicalAgent) updateGroupTable(ctx context.Context, groupMod *ofp.OfpGroupMod) error {
 	logger.Debug(ctx, "update-group-table")
 	if groupMod == nil {
diff --git a/rw_core/core/device/logical_agent_port.go b/rw_core/core/device/logical_agent_port.go
index 54fa620..e531bd5 100644
--- a/rw_core/core/device/logical_agent_port.go
+++ b/rw_core/core/device/logical_agent_port.go
@@ -424,8 +424,10 @@
 }
 
 // TODO: shouldn't need to guarantee event ordering like this
-//       event ordering should really be protected by per-LogicalPort lock
-//       once routing uses on-demand calculation only, this should be changed
+//
+//	event ordering should really be protected by per-LogicalPort lock
+//	once routing uses on-demand calculation only, this should be changed
+//
 // assignQueuePosition ensures that no events will be sent until this thread calls send() on the returned queuePosition
 func (e *orderedEvents) assignQueuePosition() queuePosition {
 	e.mutex.Lock()
@@ -498,7 +500,7 @@
 	return 0, status.Error(codes.NotFound, "No NNI port found")
 }
 
-//GetNNIPorts returns all NNI ports
+// GetNNIPorts returns all NNI ports
 func (agent *LogicalAgent) GetNNIPorts() map[uint32]struct{} {
 	return agent.portLoader.ListIDsForDevice(agent.rootDeviceID)
 }
diff --git a/rw_core/core/device/logical_agent_route.go b/rw_core/core/device/logical_agent_route.go
index 88cf105..bd6c5c1 100644
--- a/rw_core/core/device/logical_agent_route.go
+++ b/rw_core/core/device/logical_agent_route.go
@@ -90,7 +90,7 @@
 	return agent.deviceRoutes
 }
 
-//rebuildRoutes rebuilds the device routes
+// rebuildRoutes rebuilds the device routes
 func (agent *LogicalAgent) buildRoutes(ctx context.Context) error {
 	logger.Debugf(ctx, "building-routes", log.Fields{"logical-device-id": agent.logicalDeviceID})
 	if err := agent.requestQueue.WaitForGreenLight(ctx); err != nil {
@@ -118,7 +118,7 @@
 	return nil
 }
 
-//updateRoutes updates the device routes
+// updateRoutes updates the device routes
 func (agent *LogicalAgent) updateRoutes(ctx context.Context, deviceID string, devicePorts map[uint32]*voltha.Port, lp *voltha.LogicalPort, lps map[uint32]*voltha.LogicalPort) error {
 	logger.Debugw(ctx, "updateRoutes", log.Fields{"logical-device-id": agent.logicalDeviceID, "device-id": deviceID, "port:": lp})
 
@@ -131,7 +131,7 @@
 	return nil
 }
 
-//updateAllRoutes updates the device routes using all the logical ports on that device
+// updateAllRoutes updates the device routes using all the logical ports on that device
 func (agent *LogicalAgent) updateAllRoutes(ctx context.Context, deviceID string, devicePorts map[uint32]*voltha.Port) error {
 	logger.Debugw(ctx, "updateAllRoutes", log.Fields{"logical-device-id": agent.logicalDeviceID, "device-id": deviceID, "ports-count": len(devicePorts)})
 
diff --git a/rw_core/core/device/logical_manager.go b/rw_core/core/device/logical_manager.go
index 8fe04a9..1e3e386 100644
--- a/rw_core/core/device/logical_manager.go
+++ b/rw_core/core/device/logical_manager.go
@@ -119,7 +119,7 @@
 	return nil, status.Errorf(codes.NotFound, "%s", id)
 }
 
-//ListLogicalDevices returns the list of all logical devices
+// ListLogicalDevices returns the list of all logical devices
 func (ldMgr *LogicalManager) ListLogicalDevices(ctx context.Context, _ *empty.Empty) (*voltha.LogicalDevices, error) {
 	ctx = utils.WithRPCMetadataContext(ctx, "ListLogicalDevices")
 	logger.Debug(ctx, "list-all-logical-devices")
@@ -202,7 +202,7 @@
 	return ldID
 }
 
-//getLogicalDeviceFromModel retrieves the logical device data from the model.
+// getLogicalDeviceFromModel retrieves the logical device data from the model.
 func (ldMgr *LogicalManager) getLogicalDeviceFromModel(ctx context.Context, lDeviceID string) (*voltha.LogicalDevice, error) {
 	logicalDevice := &voltha.LogicalDevice{}
 	if have, err := ldMgr.ldProxy.Get(ctx, lDeviceID, logicalDevice); err != nil {
diff --git a/rw_core/core/device/logical_port/loader.go b/rw_core/core/device/logical_port/loader.go
index 61935aa..90bd172 100644
--- a/rw_core/core/device/logical_port/loader.go
+++ b/rw_core/core/device/logical_port/loader.go
@@ -180,7 +180,8 @@
 
 // ListIDs returns a snapshot of all the managed port IDs
 // TODO: iterating through ports safely is expensive now, since all ports are stored & locked separately
-//       should avoid this where possible
+//
+//	should avoid this where possible
 func (loader *Loader) ListIDs() map[uint32]struct{} {
 	loader.lock.RLock()
 	defer loader.lock.RUnlock()
diff --git a/rw_core/core/device/manager.go b/rw_core/core/device/manager.go
index e8ffacf..3dd5ea9 100755
--- a/rw_core/core/device/manager.go
+++ b/rw_core/core/device/manager.go
@@ -61,7 +61,7 @@
 	doneCh                  chan struct{}
 }
 
-//NewManagers creates the Manager and the Logical Manager.
+// NewManagers creates the Manager and the Logical Manager.
 func NewManagers(dbPath *model.Path, adapterMgr *adapter.Manager, cf *config.RWCoreFlags, coreInstanceID string, eventProxy *events.EventProxy) (*Manager, *LogicalManager) {
 	deviceMgr := &Manager{
 		rootDevices:             make(map[string]bool),
@@ -228,7 +228,7 @@
 	return exist
 }
 
-//isParentDeviceExist checks whether device is already preprovisioned.
+// isParentDeviceExist checks whether device is already preprovisioned.
 func (dMgr *Manager) isParentDeviceExist(ctx context.Context, newDevice *voltha.Device) (bool, error) {
 	hostPort := newDevice.GetHostAndPort()
 	var devices []*voltha.Device
@@ -251,7 +251,7 @@
 	return false, nil
 }
 
-//getDeviceFromModelretrieves the device data from the model.
+// getDeviceFromModelretrieves the device data from the model.
 func (dMgr *Manager) getDeviceFromModel(ctx context.Context, deviceID string) (*voltha.Device, error) {
 	device := &voltha.Device{}
 	if have, err := dMgr.dProxy.Get(ctx, deviceID, device); err != nil {
@@ -609,7 +609,7 @@
 	return status.Errorf(codes.NotFound, "%s", deviceID)
 }
 
-//UpdatePortsState updates all ports on the device
+// UpdatePortsState updates all ports on the device
 func (dMgr *Manager) UpdatePortsState(ctx context.Context, deviceID string, portTypeFilter uint32, state voltha.OperStatus_Types) error {
 	logger.Debugw(ctx, "update-ports-state", log.Fields{"device-id": deviceID})
 	agent := dMgr.getDeviceAgent(ctx, deviceID)
@@ -678,7 +678,7 @@
 therefore use the data as is without trying to get the latest from the model.
 */
 
-//DisableAllChildDevices is invoked as a callback when the parent device is disabled
+// DisableAllChildDevices is invoked as a callback when the parent device is disabled
 func (dMgr *Manager) DisableAllChildDevices(ctx context.Context, parentCurrDevice *voltha.Device) error {
 	logger.Debug(ctx, "disable-all-child-devices")
 	ports, _ := dMgr.listDevicePorts(ctx, parentCurrDevice.Id)
@@ -693,7 +693,7 @@
 	return nil
 }
 
-//getAllChildDeviceIds is a helper method to get all the child device IDs from the device passed as parameter
+// getAllChildDeviceIds is a helper method to get all the child device IDs from the device passed as parameter
 func (dMgr *Manager) getAllChildDeviceIds(ctx context.Context, parentDevicePorts map[uint32]*voltha.Port) map[string]struct{} {
 	logger.Debug(ctx, "get-all-child-device-ids")
 	childDeviceIds := make(map[string]struct{}, len(parentDevicePorts))
@@ -706,7 +706,7 @@
 	return childDeviceIds
 }
 
-//GgtAllChildDevices is a helper method to get all the child device IDs from the device passed as parameter
+// GgtAllChildDevices is a helper method to get all the child device IDs from the device passed as parameter
 func (dMgr *Manager) getAllChildDevices(ctx context.Context, parentDeviceID string) (*voltha.Devices, error) {
 	logger.Debugw(ctx, "get-all-child-devices", log.Fields{"parent-device-id": parentDeviceID})
 	if parentDevicePorts, err := dMgr.listDevicePorts(ctx, parentDeviceID); err == nil {
diff --git a/rw_core/core/device/manager_nbi.go b/rw_core/core/device/manager_nbi.go
index b978823..f5146b1 100644
--- a/rw_core/core/device/manager_nbi.go
+++ b/rw_core/core/device/manager_nbi.go
@@ -1,17 +1,17 @@
 /*
- * Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+* Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
 
- * http://www.apache.org/licenses/LICENSE-2.0
+* http://www.apache.org/licenses/LICENSE-2.0
 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* 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 device
 
@@ -92,7 +92,7 @@
 	return &empty.Empty{}, agent.disableDevice(ctx)
 }
 
-//RebootDevice invoked the reboot API to the corresponding adapter
+// RebootDevice invoked the reboot API to the corresponding adapter
 func (dMgr *Manager) RebootDevice(ctx context.Context, id *voltha.ID) (*empty.Empty, error) {
 	ctx = utils.WithRPCMetadataContext(ctx, "RebootDevice")
 	log.EnrichSpan(ctx, log.Fields{"device-id": id.Id})
diff --git a/rw_core/core/device/manager_sbi.go b/rw_core/core/device/manager_sbi.go
index 0a5eff8..c8269bc 100644
--- a/rw_core/core/device/manager_sbi.go
+++ b/rw_core/core/device/manager_sbi.go
@@ -1,17 +1,17 @@
 /*
- * Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+* Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
 
- * http://www.apache.org/licenses/LICENSE-2.0
+* http://www.apache.org/licenses/LICENSE-2.0
 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* 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 device
 
@@ -251,8 +251,8 @@
 	return &empty.Empty{}, nil
 }
 
-//ChildDevicesLost is invoked by an adapter to indicate that a parent device is in a state (Disabled) where it
-//cannot manage the child devices.  This will trigger the Core to disable all the child devices.
+// ChildDevicesLost is invoked by an adapter to indicate that a parent device is in a state (Disabled) where it
+// cannot manage the child devices.  This will trigger the Core to disable all the child devices.
 func (dMgr *Manager) ChildDevicesLost(ctx context.Context, parentID *common.ID) (*empty.Empty, error) {
 	ctx = utils.WithNewSpanAndRPCMetadataContext(ctx, "ChildDevicesLost")
 	logger.Debugw(ctx, "child-devices-lost", log.Fields{"parent-id": parentID.Id})
@@ -268,7 +268,7 @@
 	return &empty.Empty{}, nil
 }
 
-//ChildDevicesDetected is invoked by an adapter when child devices are found, typically after after a
+// ChildDevicesDetected is invoked by an adapter when child devices are found, typically after after a
 // disable/enable sequence.  This will trigger the Core to Enable all the child devices of that parent.
 func (dMgr *Manager) ChildDevicesDetected(ctx context.Context, parentDeviceID *common.ID) (*empty.Empty, error) {
 	ctx = utils.WithNewSpanAndRPCMetadataContext(ctx, "ChildDevicesDetected")
diff --git a/rw_core/core/device/manager_state_callback.go b/rw_core/core/device/manager_state_callback.go
index 4dc5b7e..9fa7c53 100644
--- a/rw_core/core/device/manager_state_callback.go
+++ b/rw_core/core/device/manager_state_callback.go
@@ -1,17 +1,17 @@
 /*
- * Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
+* Copyright 2021-2023 Open Networking Foundation (ONF) and the ONF Contributors
 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
 
- * http://www.apache.org/licenses/LICENSE-2.0
+* http://www.apache.org/licenses/LICENSE-2.0
 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* 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 device
 
@@ -26,8 +26,7 @@
 	"google.golang.org/grpc/status"
 )
 
-//
-//CreateLogicalDevice creates logical device in core
+// CreateLogicalDevice creates logical device in core
 func (dMgr *Manager) CreateLogicalDevice(ctx context.Context, cDevice *voltha.Device) error {
 	logger.Info(ctx, "create-logical-device")
 	// Verify whether the logical device has already been created
@@ -103,7 +102,7 @@
 	return nil
 }
 
-//DeleteAllLogicalPorts is invoked as a callback when the parent device's connection status moves to UNREACHABLE
+// DeleteAllLogicalPorts is invoked as a callback when the parent device's connection status moves to UNREACHABLE
 func (dMgr *Manager) DeleteAllLogicalPorts(ctx context.Context, parentDevice *voltha.Device) error {
 	logger.Debugw(ctx, "delete-all-logical-ports", log.Fields{"parent-device-id": parentDevice.Id})
 	if err := dMgr.logicalDeviceMgr.deleteAllLogicalPorts(ctx, parentDevice); err != nil {
@@ -150,7 +149,7 @@
 	return nil
 }
 
-//DeleteAllDeviceFlows is invoked as a callback when the parent device's connection status moves to UNREACHABLE
+// DeleteAllDeviceFlows is invoked as a callback when the parent device's connection status moves to UNREACHABLE
 func (dMgr *Manager) DeleteAllDeviceFlows(ctx context.Context, parentDevice *voltha.Device) error {
 	logger.Debugw(ctx, "delete-all-device-flows", log.Fields{"parent-device-id": parentDevice.Id})
 	if agent := dMgr.getDeviceAgent(ctx, parentDevice.Id); agent != nil {
diff --git a/rw_core/core/device/meter/loader.go b/rw_core/core/device/meter/loader.go
index 941a23c..ffc8c48 100644
--- a/rw_core/core/device/meter/loader.go
+++ b/rw_core/core/device/meter/loader.go
@@ -160,7 +160,8 @@
 
 // ListIDs returns a snapshot of all the managed meter IDs
 // TODO: iterating through meters safely is expensive now, since all meters are stored & locked separately
-//       should avoid this where possible
+//
+//	should avoid this where possible
 func (loader *Loader) ListIDs() map[uint32]struct{} {
 	loader.lock.RLock()
 	defer loader.lock.RUnlock()
diff --git a/rw_core/core/device/port/loader.go b/rw_core/core/device/port/loader.go
index 2f322ef..c6b31e9 100644
--- a/rw_core/core/device/port/loader.go
+++ b/rw_core/core/device/port/loader.go
@@ -174,7 +174,8 @@
 
 // ListIDs returns a snapshot of all the managed port IDs
 // TODO: iterating through ports safely is expensive now, since all ports are stored & locked separately
-//       should avoid this where possible
+//
+//	should avoid this where possible
 func (loader *Loader) ListIDs() map[uint32]struct{} {
 	loader.lock.RLock()
 	defer loader.lock.RUnlock()