MCPcopy
hub / github.com/nats-io/nats.go / argInfo

Function argInfo

enc.go:176–186  ·  view source on GitHub ↗

Dissect the cb Handler's signature

(cb Handler)

Source from the content-addressed store, hash-verified

174
175// Dissect the cb Handler's signature
176func argInfo(cb Handler) (reflect.Type, int) {
177 cbType := reflect.TypeOf(cb)
178 if cbType.Kind() != reflect.Func {
179 panic("nats: Handler needs to be a func")
180 }
181 numArgs := cbType.NumIn()
182 if numArgs == 0 {
183 return nil, numArgs
184 }
185 return cbType.In(numArgs - 1), numArgs
186}
187
188var emptyMsgType = reflect.TypeOf(&Msg{})
189

Callers 1

subscribeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected