Fixing golang linters for VGC
Change-Id: I386d232c74ab47e24d92c18800dc144120b920da
diff --git a/internal/pkg/util/concurrentmap.go b/internal/pkg/util/concurrentmap.go
index f16bb29..380e3aa 100644
--- a/internal/pkg/util/concurrentmap.go
+++ b/internal/pkg/util/concurrentmap.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 util
@@ -23,8 +23,8 @@
// ConcurrentMap implements a wrapper on top of SyncMap so that the count is also maintained
type ConcurrentMap struct {
- syncMap sync.Map
count *atomic.Uint64
+ syncMap sync.Map
MapLock sync.RWMutex
}
@@ -36,7 +36,7 @@
}
// Get - Gets return the value store in the sync map
-//If value is present, the result will be true else false
+// If value is present, the result will be true else false
func (cm *ConcurrentMap) Get(key interface{}) (value interface{}, result bool) {
return cm.syncMap.Load(key)
}
@@ -55,7 +55,6 @@
// Remove - Removes the key-value pair from the sync map
func (cm *ConcurrentMap) Remove(key interface{}) bool {
-
if _, ok := cm.syncMap.Load(key); ok {
cm.syncMap.Delete(key)
cm.count.Dec()
diff --git a/internal/pkg/util/utils.go b/internal/pkg/util/utils.go
index 313a8ff..6157413 100644
--- a/internal/pkg/util/utils.go
+++ b/internal/pkg/util/utils.go
@@ -39,9 +39,8 @@
return s
}
-//IsSliceSame - check and return true if the two slices are identical
+// IsSliceSame - check and return true if the two slices are identical
func IsSliceSame(ref, rcvd []uint32) bool {
-
var found bool
if len(ref) != len(rcvd) {
return false
@@ -63,9 +62,8 @@
return true
}
-//IsPbitSliceSame - check and return true if the two slices are identical
+// IsPbitSliceSame - check and return true if the two slices are identical
func IsPbitSliceSame(ref, rcvd []of.PbitType) bool {
-
var found bool
if len(ref) != len(rcvd) {
return false