go fix my shit
All checks were successful
/ test (push) Successful in 51s

This commit is contained in:
Neemek 2026-09-23 09:13:28 +02:00
parent 0db420aae4
commit 7245af0438
Signed by: neemek
GPG key ID: 433EA4A50D4F55A3
5 changed files with 35 additions and 30 deletions

View file

@ -55,7 +55,7 @@ func (v ValueType) String() string {
}
// GoToValue convert go values to anglais VM-values. Works for some values (nil, bool, float64, int, string, slices, maps)
func GoToValue(gov interface{}) Value {
func GoToValue(gov any) Value {
switch v := gov.(type) {
case nil:
return &NilValue{}
@ -79,7 +79,7 @@ func GoToValue(gov interface{}) Value {
return &StringValue{
v,
}
case map[string]interface{}:
case map[string]any:
values := map[string]Value{}
for key, value := range v {
values[key] = GoToValue(value)
@ -447,16 +447,17 @@ func (v *ListValue) Type() ValueType {
}
func (v *ListValue) String() string {
out := "["
var out strings.Builder
out.WriteString("[")
for i, item := range v.Items {
if i != 0 {
out += ", "
out.WriteString(", ")
}
out += item.DebugString()
out.WriteString(item.DebugString())
}
out += "]"
out.WriteString("]")
return out
return out.String()
}
func (v *ListValue) DebugString() string {
@ -613,20 +614,21 @@ func (v *TupleValue) Type() ValueType {
}
func (v *TupleValue) String() string {
out := "("
var out strings.Builder
out.WriteString("(")
for i, item := range v.Items {
if i != 0 {
out += ", "
out.WriteString(", ")
}
out += item.DebugString()
out.WriteString(item.DebugString())
}
if len(v.Items) <= 1 {
out += ","
out.WriteString(",")
}
out += ")"
out.WriteString(")")
return out
return out.String()
}
func (v *TupleValue) DebugString() string {