update go tree for reflect changes

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4353043
This commit is contained in:
Russ Cox 2011-04-08 12:27:58 -04:00
parent fb94eb1922
commit db5c5d6fa6
40 changed files with 693 additions and 686 deletions

View file

@ -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