MCPcopy
hub / github.com/grpc/grpc-go / combine

Function combine

call.go:40–53  ·  view source on GitHub ↗
(o1 []CallOption, o2 []CallOption)

Source from the content-addressed store, hash-verified

38}
39
40func combine(o1 []CallOption, o2 []CallOption) []CallOption {
41 // we don't use append because o1 could have extra capacity whose
42 // elements would be overwritten, which could cause inadvertent
43 // sharing (and race conditions) between concurrent calls
44 if len(o1) == 0 {
45 return o2
46 } else if len(o2) == 0 {
47 return o1
48 }
49 ret := make([]CallOption, len(o1)+len(o2))
50 copy(ret, o1)
51 copy(ret[len(o1):], o2)
52 return ret
53}
54
55// Invoke sends the RPC request on the wire and returns after response is
56// received. This is typically called by generated code.

Callers 2

NewStreamMethod · 0.85
InvokeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected