@@ -177,6 +177,8 @@ func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
177177 return cc .NewStream (ctx , desc , method , opts ... )
178178}
179179
180+ var emptyMethodConfig = serviceconfig.MethodConfig {}
181+
180182func newClientStream (ctx context.Context , desc * StreamDesc , cc * ClientConn , method string , opts ... CallOption ) (_ ClientStream , err error ) {
181183 // Start tracking the RPC for idleness purposes. This is where a stream is
182184 // created for both streaming and unary RPCs, and hence is a good place to
@@ -217,7 +219,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
217219 return nil , err
218220 }
219221
220- var mc serviceconfig. MethodConfig
222+ mc := & emptyMethodConfig
221223 var onCommit func ()
222224 newStream := func (ctx context.Context , done func ()) (iresolver.ClientStream , error ) {
223225 return newClientStreamWithParams (ctx , desc , cc , method , mc , onCommit , done , nameResolutionDelayed , opts ... )
@@ -240,7 +242,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
240242 if rpcConfig .Context != nil {
241243 ctx = rpcConfig .Context
242244 }
243- mc = rpcConfig .MethodConfig
245+ mc = & rpcConfig .MethodConfig
244246 onCommit = rpcConfig .OnCommitted
245247 if rpcConfig .Interceptor != nil {
246248 rpcInfo .Context = nil
@@ -258,7 +260,7 @@ func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, meth
258260 return newStream (ctx , func () {})
259261}
260262
261- func newClientStreamWithParams (ctx context.Context , desc * StreamDesc , cc * ClientConn , method string , mc serviceconfig.MethodConfig , onCommit , doneFunc func (), nameResolutionDelayed bool , opts ... CallOption ) (_ iresolver.ClientStream , err error ) {
263+ func newClientStreamWithParams (ctx context.Context , desc * StreamDesc , cc * ClientConn , method string , mc * serviceconfig.MethodConfig , onCommit , doneFunc func (), nameResolutionDelayed bool , opts ... CallOption ) (_ iresolver.ClientStream , err error ) {
262264 callInfo := defaultCallInfo ()
263265 if mc .WaitForReady != nil {
264266 callInfo .failFast = ! * mc .WaitForReady
@@ -325,7 +327,7 @@ func newClientStreamWithParams(ctx context.Context, desc *StreamDesc, cc *Client
325327 cs := & clientStream {
326328 callHdr : callHdr ,
327329 ctx : ctx ,
328- methodConfig : & mc ,
330+ methodConfig : mc ,
329331 opts : opts ,
330332 callInfo : callInfo ,
331333 cc : cc ,
0 commit comments