We don't need sync.Once, we can just select
This commit is contained in:
@@ -75,11 +75,9 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp
|
||||
return errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
||||
}
|
||||
|
||||
var once sync.Once
|
||||
stream := &rpcStream{
|
||||
context: ctx,
|
||||
request: req,
|
||||
once: once,
|
||||
closed: make(chan bool),
|
||||
codec: newRpcPlusCodec(msg, c, cf),
|
||||
}
|
||||
@@ -139,11 +137,9 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request, opt
|
||||
return nil, errors.InternalServerError("go.micro.client", fmt.Sprintf("Error sending request: %v", err))
|
||||
}
|
||||
|
||||
var once sync.Once
|
||||
stream := &rpcStream{
|
||||
context: ctx,
|
||||
request: req,
|
||||
once: once,
|
||||
closed: make(chan bool),
|
||||
codec: newRpcPlusCodec(msg, c, cf),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user