feat: automatic injection parameters

This commit is contained in:
huchenhao 2024-03-20 09:57:12 +08:00
parent dd10c68afb
commit cadbd48538
2 changed files with 0 additions and 4 deletions

View File

@ -39,7 +39,6 @@ func NewFaaSDesc(fnName string, f FaaS) (*FaaSDesc, error) {
for i := 0; i < funcType.NumIn(); i++ {
paramType := funcType.In(i)
fmt.Println(paramType.Kind(), isFlowType(paramType))
if isFlowType(paramType) {
containsKisflowCtx = true
}

View File

@ -15,9 +15,7 @@ func (f DefaultFaasSerialize) DecodeParam(arr common.KisRowArr, r reflect.Type)
if r.Kind() != reflect.Slice {
return reflect.Value{}, fmt.Errorf("r must be a slice")
}
slice := reflect.MakeSlice(r, 0, len(arr))
for _, row := range arr {
var elem reflect.Value
var err error
@ -28,7 +26,6 @@ func (f DefaultFaasSerialize) DecodeParam(arr common.KisRowArr, r reflect.Type)
// 如果失败,则尝试直接反序列化为字符串
elem, err = decodeString(row)
if err != nil {
fmt.Println("---+++-", row)
// 如果还失败,则尝试先序列化为 JSON 再反序列化
elem, err = decodeJSON(row, r.Elem())
if err != nil {