From 70ef0fb973fca103f61fedc59aeda6375dfe8b8a Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Tue, 2 Jul 2024 17:32:05 -0700 Subject: [PATCH] avoid using map pointers as maps are always passed by reference Signed-off-by: Tariq Ibrahim --- tools/container/operator/operator.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/container/operator/operator.go b/tools/container/operator/operator.go index 780aa5c7..d88e9faf 100644 --- a/tools/container/operator/operator.go +++ b/tools/container/operator/operator.go @@ -25,14 +25,14 @@ const ( ) // Runtime defines a runtime to be configured. -// The path and whether the runtime is the default runtime can be specfied +// The path and whether the runtime is the default runtime can be specified type Runtime struct { name string Path string SetAsDefault bool } -// Runtimes defines a set of runtimes to be configure for use in the GPU Operator +// Runtimes defines a set of runtimes to be configured for use in the GPU Operator type Runtimes map[string]Runtime type config struct { @@ -76,8 +76,8 @@ func (r Runtimes) DefaultRuntimeName() string { } // Add a runtime to the set of runtimes. -func (r *Runtimes) add(runtime Runtime) { - (*r)[runtime.name] = runtime +func (r Runtimes) add(runtime Runtime) { + r[runtime.name] = runtime } // nvidiaRuntime creates a runtime that corresponds to the nvidia runtime.