cleanup: append pointer instead of value to avoid copying lock value

This commit resolves the govet issue -
`copylocks: call of append copies lock value ... contains sync.Mutex`

Embedding DoNotCopy in a struct is a convention to signal and prevent
shallow copies, as recommended in Go's best practices. This does not
rely on a language feature but is instead a special case within the vet
checker.

For more details, see https://golang.org/issues/8005

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2024-07-10 12:00:03 +05:30
committed by mergify[bot]
parent 69ef70e25b
commit d376271376
2 changed files with 8 additions and 8 deletions

View File

@ -211,7 +211,7 @@ func FindPoolAndTopology(topologyPools *[]TopologyConstrainedPool,
return "", "", nil, fmt.Errorf("none of the topology constrained pools matched requested "+
"topology constraints : pools (%+v) requested topology (%+v)",
*topologyPools, *accessibilityRequirements)
*topologyPools, accessibilityRequirements)
}
// matchPoolToTopology loops through passed in pools, and for each pool checks if all