Go: fix encoding parameters to Go representation (#17525)

This commit is contained in:
andig 2024-12-01 11:40:34 +01:00 • committed by GitHub
parent fe68c91554
commit 81fdf0fac7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -186,11 +186,7 @@ func (p *Go) evaluate() (res any, err error) {
}
func (p *Go) setParam(param string, val any) error {
if str, ok := val.(string); ok {
val = "\"" + str + "\""
}
_, err := p.vm.Eval(fmt.Sprintf("%s := %v;", param, val))
_, err := p.vm.Eval(fmt.Sprintf("%s := %#v;", param, val))
return err
}