cleanup: remove unused code and suppress staticcheck warning

Removed the Windows-specific check from TestMain as it is no longer necessary. Added a staticcheck ignore comment to bypass the SA1019 warning in the devicemapper wrapper for compatibility purposes. These changes ensure cleaner and more focused code.

Signed-off-by: Andrey Epifanov <aepifanov@mirantis.com>
This commit is contained in:
Andrey Epifanov
2025-04-24 01:13:10 -07:00
parent 465e60b8a8
commit 9b16b8eb86
2 changed files with 1 additions and 6 deletions

View File

@@ -11,7 +11,6 @@ import (
"net/http/httptest"
"os"
"path/filepath"
"runtime"
"testing"
"github.com/docker/docker/libnetwork"
@@ -31,10 +30,6 @@ import (
var controller libnetwork.NetworkController
func TestMain(m *testing.M) {
if runtime.GOOS == "windows" {
logrus.Info("Test suite does not currently support windows")
os.Exit(0)
}
if reexec.Init() {
return
}

View File

@@ -150,7 +150,7 @@ func dmTaskGetDepsFct(task *cdmTask) *Deps {
// golang issue: https://github.com/golang/go/issues/11925
var devices []C.uint64_t
devicesHdr := (*reflect.SliceHeader)(unsafe.Pointer(&devices))
devicesHdr := (*reflect.SliceHeader)(unsafe.Pointer(&devices)) //nolint:staticcheck // ignore SA1019
devicesHdr.Data = uintptr(unsafe.Pointer(uintptr(unsafe.Pointer(Cdeps)) + unsafe.Sizeof(*Cdeps)))
devicesHdr.Len = int(Cdeps.count)
devicesHdr.Cap = int(Cdeps.count)