mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user