move helper to proper place

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-10-09 16:21:47 +03:00
parent 2682f15b8e
commit 336868ed0d

View File

@ -103,3 +103,18 @@ func ExtractEndpoint(method reflect.Method) *Endpoint {
return ep return ep
} }
func ExtractSubValue(typ reflect.Type) *Value {
var reqType reflect.Type
switch typ.NumIn() {
case 1:
reqType = typ.In(0)
case 2:
reqType = typ.In(1)
case 3:
reqType = typ.In(2)
default:
return nil
}
return ExtractValue(reqType, 0)
}