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 eacc993 commit 2cd5808Copy full SHA for 2cd5808
internal/cmd/generate/commands/gentests/generator.go
@@ -1026,7 +1026,16 @@ func (g *Generator) genAction(a Action, skipBody ...bool) {
1026
re := regexp.MustCompile("^(\\d+).*")
1027
value = re.ReplaceAllString(fmt.Sprintf("%d", v), "$1")
1028
case "*int":
1029
- g.w(`esapi.IntPtr(` + fmt.Sprintf("%d", v) + `)`)
+ switch v.(type) {
1030
+ case int:
1031
+ g.w(`esapi.IntPtr(` + fmt.Sprintf("%d", v) + `)`)
1032
+ case float64:
1033
+ if vv, ok := v.(float64); ok {
1034
+ g.w(`esapi.IntPtr(` + fmt.Sprintf("%d", int(vv)) + `)`)
1035
+ }
1036
+ default:
1037
+ panic(fmt.Sprintf("Unexpected type [%T] for [%s]", v, k))
1038
1039
default:
1040
value = fmt.Sprintf("%v", v)
1041
}
0 commit comments