We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be6af55 commit 243da22Copy full SHA for 243da22
pkg/cmd/io.go
@@ -43,7 +43,21 @@ func parseInput(stdin io.Reader) *types.Inputs {
43
}
44
45
if maxLength, ok := inputsMap["max_length"]; ok {
46
- inputs.MaxLength = int(maxLength.(float64))
+ switch maxLength.(type) {
47
+ case float64:
48
+ inputs.MaxLength = int(maxLength.(float64))
49
+ break
50
+ case string:
51
+ var convError error
52
+ inputs.MaxLength, convError = strconv.Atoi(maxLength.(string))
53
+ if convError != nil {
54
+ log.Fatalf("Error unmarshaling inputs.max_length; %v", convError)
55
+ }
56
57
+ case int64:
58
+ inputs.MaxLength = int(maxLength.(int64))
59
60
61
62
63
return &inputs
0 commit comments