Skip to content

Commit 58d5a77

Browse files
match Int input args type with int and int64
1 parent bd649a1 commit 58d5a77

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
@@ -342,12 +342,34 @@ func unmarshalInput(typ reflect.Type, input interface{}) (interface{}, error) {
342342
return coerced, nil
343343
}
344344

345+
case reflect.Int:
346+
switch input := input.(type) {
347+
case int32:
348+
return int(input), nil
349+
case int64:
350+
return int(input), nil
351+
case float64:
352+
return int(input), nil
353+
}
354+
355+
case reflect.Int64:
356+
switch input := input.(type) {
357+
case int32:
358+
return int64(input), nil
359+
case int:
360+
return int64(input), nil
361+
case float64:
362+
return int64(input), nil
363+
}
364+
345365
case reflect.Float64:
346366
switch input := input.(type) {
347367
case int32:
348368
return float64(input), nil
349369
case int:
350370
return float64(input), nil
371+
case int64:
372+
return float64(input), nil
351373
}
352374

353375
case reflect.String:

0 commit comments

Comments
 (0)