| func makeResultPtrs(ins []interface{}) []interface{} { |
| outs := make([]interface{}, len(ins)) |
| for ix, in := range ins { |
| typ := reflect.TypeOf(in) |
| // nil interfaces can only imply an error. |
| // This is in sync with result2vom in server.go. The |
| // reasons for this check and conditions for when it |
| // can be removed can be seen in the comments for |
| typ = reflect.ValueOf(&verr).Elem().Type() |
| outs[ix] = reflect.New(typ).Interface() |
| func checkResultPtrs(t *testing.T, name string, gotptrs, want []interface{}) { |
| for ix, res := range gotptrs { |
| got := reflect.ValueOf(res).Elem().Interface() |
| if !reflect.DeepEqual(got, want) { |
| t.Errorf("%s result %d got %v, want %v", name, ix, got, want) |