github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/internal/reflect/pointer_test.go (about) 1 package reflect 2 3 import "testing" 4 5 func TestPointer(t *testing.T) { 6 ptr := new(int) 7 *ptr = 1 << 10 8 ptr2 := PtrDeriveValue(ptr, 10).(*int) 9 if *ptr2 != 10 { 10 panic(interface{}("*ptr2 value is no correct")) 11 } 12 }