go-python / gopy

gopy generates a CPython extension module from a go package.
BSD 3-Clause "New" or "Revised" License
2k stars 112 forks source link

A function that returns a []map[string]interface{} is incorrect for integer types #360

Open richecr opened 1 month ago

richecr commented 1 month ago
func Test() ([]map[string]interface{}, error) {
    var result []map[string]interface{}
    rowMap := make(map[string]interface{})
    rowMap["id"] = 1
    rowMap["test"] = 2
    rowMap["name"] = "adadada"
    result = append(result, rowMap)
    return result, nil
}
print(test())

Integer types are returned in Python as a string %!s(int={value})