Bulk move from k8s.io/kubectl

This commit is contained in:
Jeffrey Regan
2018-05-11 14:07:15 -07:00
parent c2048aae17
commit 83b3eb9d54
4223 changed files with 1815034 additions and 110 deletions

View File

@@ -0,0 +1,25 @@
package tests
import (
"testing"
"github.com/modern-go/reflect2"
"github.com/modern-go/test/must"
"github.com/modern-go/test"
"context"
)
func Test_struct_ptr(t *testing.T) {
type TestObject struct {
Field1 *int
}
t.Run("PackEFace", test.Case(func(ctx context.Context) {
valType := reflect2.TypeOf(TestObject{})
ptr := valType.UnsafeNew()
must.Equal(&TestObject{}, valType.PackEFace(ptr))
}))
t.Run("Indirect", test.Case(func(ctx context.Context) {
valType := reflect2.TypeOf(TestObject{})
must.Equal(TestObject{}, valType.Indirect(&TestObject{}))
}))
}