Skip to content

Commit c84bfdd

Browse files
match Int input args type with int and int64
1 parent cb2249a commit c84bfdd

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

internal/exec/packer/packer.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,34 @@ func unmarshalInput(typ reflect.Type, input interface{}) (interface{}, error) {
355355
return coerced, nil
356356
}
357357

358+
case reflect.Int:
359+
switch input := input.(type) {
360+
case int32:
361+
return int(input), nil
362+
case int64:
363+
return int(input), nil
364+
case float64:
365+
return int(input), nil
366+
}
367+
368+
case reflect.Int64:
369+
switch input := input.(type) {
370+
case int32:
371+
return int64(input), nil
372+
case int:
373+
return int64(input), nil
374+
case float64:
375+
return int64(input), nil
376+
}
377+
358378
case reflect.Float64:
359379
switch input := input.(type) {
360380
case int32:
361381
return float64(input), nil
362382
case int:
363383
return float64(input), nil
384+
case int64:
385+
return float64(input), nil
364386
}
365387

366388
case reflect.String:

0 commit comments

Comments
 (0)