cleanup: use index instead of value while iterating

This commit cleans up for loop to use index to access
value instead of copying value into a new variable
while iterating.
```
internal/util/csiconfig.go:103:2: rangeValCopy: each \
iteration copies 136 bytes (consider pointers or indexing) \
(gocritic)
        for _, cluster := range config {
```

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R 2022-08-05 16:31:31 +05:30 committed by mergify[bot]
parent 48d66d6cfd
commit d39d2cffcc

View File

@ -100,9 +100,9 @@ func readClusterInfo(pathToConfig, clusterID string) (*ClusterInfo, error) {
err, string(content))
}
for _, cluster := range config {
if cluster.ClusterID == clusterID {
return &cluster, nil
for i := range config {
if config[i].ClusterID == clusterID {
return &config[i], nil
}
}