Added note on usage of reflect.Indirect in grpc.NewClient
Bas van Beek
8 years ago
37 | 37 | method: fmt.Sprintf("/pb.%s/%s", serviceName, method), |
38 | 38 | enc: enc, |
39 | 39 | dec: dec, |
40 | // We are using reflect.Indirect here to allow both reply structs and | |
41 | // pointers to these reply structs. New consumers of the client should | |
42 | // use structs directly, while existing consumers will not break if they | |
43 | // remain to use pointers to structs. | |
40 | 44 | grpcReply: reflect.TypeOf( |
41 | 45 | reflect.Indirect( |
42 | 46 | reflect.ValueOf(grpcReply), |