[no-relnotes] Update moq to use rm and goimports

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2025-03-12 13:11:37 +02:00
parent 57f077fce7
commit 2a9bae8e80
15 changed files with 16 additions and 15 deletions

View File

@@ -167,7 +167,7 @@ func generateInterfaceComment(input GeneratableInterfacePoperties) (string, erro
commentFmt := []string{
"// %s represents the interface for the %s type.",
"//",
"//go:generate moq -out mock/%s.go -pkg mock . %s:%s",
"//go:generate moq -rm -fmt=goimports -out mock/%s.go -pkg mock . %s:%s",
}
var signature strings.Builder

View File

@@ -35,7 +35,7 @@ var errLibraryAlreadyLoaded = errors.New("library already loaded")
// dynamicLibrary is an interface for abstacting the underlying library.
// This also allows for mocking and testing.
//go:generate moq -rm -stub -out dynamicLibrary_mock.go . dynamicLibrary
//go:generate moq -rm -fmt=goimports -stub -out dynamicLibrary_mock.go . dynamicLibrary
type dynamicLibrary interface {
Lookup(string) error
Open() error

View File

@@ -4,8 +4,9 @@
package mock
import (
"github.com/NVIDIA/nvidia-container-toolkit/internal/nvsandboxutils"
"sync"
"github.com/NVIDIA/nvidia-container-toolkit/internal/nvsandboxutils"
)
// Ensure, that Interface does implement nvsandboxutils.Interface.

View File

@@ -31,7 +31,7 @@ var (
// Interface represents the interface for the library type.
//
//go:generate moq -out mock/interface.go -pkg mock . Interface:Interface
//go:generate moq -rm -fmt=goimports -out mock/interface.go -pkg mock . Interface:Interface
type Interface interface {
ErrorString(Ret) string
GetDriverVersion() (string, Ret)