some deletions
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201105173854-bc9fc8d8c4bc / go / analysis / passes / unsafeptr / testdata / src / a / issue40701.go
diff --git a/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/go/analysis/passes/unsafeptr/testdata/src/a/issue40701.go b/.config/coc/extensions/coc-go-data/tools/pkg/mod/golang.org/x/tools@v0.0.0-20201105173854-bc9fc8d8c4bc/go/analysis/passes/unsafeptr/testdata/src/a/issue40701.go
deleted file mode 100644 (file)
index 1f87697..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2020 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package a
-
-import (
-       "reflect"
-       "unsafe"
-)
-
-// Explicitly allocating a variable of type reflect.SliceHeader.
-func _(p *byte, n int) []byte {
-       var sh reflect.SliceHeader
-       sh.Data = uintptr(unsafe.Pointer(p))
-       sh.Len = n
-       sh.Cap = n
-       return *(*[]byte)(unsafe.Pointer(&sh)) // want "possible misuse of reflect.SliceHeader"
-}
-
-// Implicitly allocating a variable of type reflect.SliceHeader.
-func _(p *byte, n int) []byte {
-       return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ // want "possible misuse of reflect.SliceHeader"
-               Data: uintptr(unsafe.Pointer(p)),
-               Len:  n,
-               Cap:  n,
-       }))
-}
-
-// Use reflect.StringHeader as a composite literal value.
-func _(p *byte, n int) []byte {
-       var res []byte
-       *(*reflect.StringHeader)(unsafe.Pointer(&res)) = reflect.StringHeader{ // want "possible misuse of reflect.StringHeader"
-               Data: uintptr(unsafe.Pointer(p)),
-               Len:  n,
-       }
-       return res
-}
-
-func _() {
-       // don't crash when obj.Pkg() == nil
-       var err error
-       _ = &err
-}