mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
update go tree for reflect changes
R=golang-dev, r CC=golang-dev https://golang.org/cl/4353043
This commit is contained in:
parent
fb94eb1922
commit
db5c5d6fa6
40 changed files with 693 additions and 686 deletions
|
|
@ -21,7 +21,7 @@ type tx struct {
|
|||
x int
|
||||
}
|
||||
|
||||
var txType = reflect.Typeof((*tx)(nil)).(*reflect.PtrType).Elem().(*reflect.StructType)
|
||||
var txType = reflect.Typeof((*tx)(nil)).Elem()
|
||||
|
||||
// A type that can unmarshal itself.
|
||||
|
||||
|
|
@ -138,8 +138,8 @@ func TestUnmarshal(t *testing.T) {
|
|||
continue
|
||||
}
|
||||
// v = new(right-type)
|
||||
v := reflect.NewValue(tt.ptr).(*reflect.PtrValue)
|
||||
v.PointTo(reflect.MakeZero(v.Type().(*reflect.PtrType).Elem()))
|
||||
v := reflect.NewValue(tt.ptr)
|
||||
v.Set(reflect.Zero(v.Type().Elem()).Addr())
|
||||
if err := Unmarshal([]byte(in), v.Interface()); !reflect.DeepEqual(err, tt.err) {
|
||||
t.Errorf("#%d: %v want %v", i, err, tt.err)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue