feature: isolate stdlib "unsafe" package (#228)

This commit is contained in:
Marc Vertes
2019-06-18 12:00:32 +02:00
committed by Ludovic Fernandez
parent 84ab137ab6
commit 85c11a9ec6
5 changed files with 15 additions and 4 deletions

View File

@@ -0,0 +1,22 @@
// +build go1.11,!go1.12
package unsafe
// Code generated by 'goexports unsafe'. DO NOT EDIT.
import (
"reflect"
"unsafe"
)
func init() {
Value["unsafe"] = map[string]reflect.Value{
// function, constant and variable definitions
// type definitions
"Pointer": reflect.ValueOf((*unsafe.Pointer)(nil)),
// interface wrapper definitions
}
}

View File

@@ -0,0 +1,22 @@
// +build go1.12,!go1.13
package unsafe
// Code generated by 'goexports unsafe'. DO NOT EDIT.
import (
"reflect"
"unsafe"
)
func init() {
Value["unsafe"] = map[string]reflect.Value{
// function, constant and variable definitions
// type definitions
"Pointer": reflect.ValueOf((*unsafe.Pointer)(nil)),
// interface wrapper definitions
}
}

11
stdlib/unsafe/unsafe.go Normal file
View File

@@ -0,0 +1,11 @@
package unsafe
import "reflect"
// Value stores the map of stdlib values per package
var Value = map[string]map[string]reflect.Value{}
// Wrapper stores the map of stdlib interface wrapper types per package
var Wrapper = map[string]map[string]reflect.Type{}
//go:generate ../../cmd/goexports/goexports unsafe