From e6dabfa97721805762c6402289169edfea4617b7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 31 May 2021 13:08:46 +0200 Subject: [PATCH] graphdriver: temporarily ignore unsafeptr: possible misuse of reflect.SliceHeader Probably needs a similar change as c208f03fbddb4355729c3225bb2550c4d54a2c5e, but this code makes my head spin, so for now suppressing, and created a tracking issue: daemon/graphdriver/graphtest/graphtest_unix.go:305:12: unsafeptr: possible misuse of reflect.SliceHeader (govet) header := *(*reflect.SliceHeader)(unsafe.Pointer(&buf)) ^ daemon/graphdriver/graphtest/graphtest_unix.go:308:36: unsafeptr: possible misuse of reflect.SliceHeader (govet) data := *(*[]byte)(unsafe.Pointer(&header)) ^ Signed-off-by: Sebastiaan van Stijn --- daemon/graphdriver/graphtest/graphtest_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/graphdriver/graphtest/graphtest_unix.go b/daemon/graphdriver/graphtest/graphtest_unix.go index 4073e0b7a0..f0c0e78f81 100644 --- a/daemon/graphdriver/graphtest/graphtest_unix.go +++ b/daemon/graphdriver/graphtest/graphtest_unix.go @@ -302,10 +302,10 @@ func writeRandomFile(path string, size uint64) error { } // Cast to []byte - header := *(*reflect.SliceHeader)(unsafe.Pointer(&buf)) + header := *(*reflect.SliceHeader)(unsafe.Pointer(&buf)) //nolint:govet // FIXME: unsafeptr: possible misuse of reflect.SliceHeader (govet) see https://github.com/moby/moby/issues/42444 header.Len *= 8 header.Cap *= 8 - data := *(*[]byte)(unsafe.Pointer(&header)) + data := *(*[]byte)(unsafe.Pointer(&header)) //nolint:govet // FIXME: unsafeptr: possible misuse of reflect.SliceHeader (govet) see https://github.com/moby/moby/issues/42444 return ioutil.WriteFile(path, data, 0700) }