mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
changes for more restricted reflect.SetValue
R=golang-dev, r CC=golang-dev https://golang.org/cl/4423043
This commit is contained in:
parent
40fccbce6b
commit
cded21a337
14 changed files with 78 additions and 56 deletions
|
|
@ -138,8 +138,7 @@ func TestUnmarshal(t *testing.T) {
|
|||
continue
|
||||
}
|
||||
// v = new(right-type)
|
||||
v := reflect.NewValue(tt.ptr)
|
||||
v.Set(reflect.Zero(v.Type().Elem()).Addr())
|
||||
v := reflect.New(reflect.Typeof(tt.ptr).Elem())
|
||||
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