-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json: unsupported type: map[interface {}]interface {} #264
Comments
package main
import (
"fmt"
"encoding/json"
"github.com/json-iterator/go"
)
func main() {
a, err := jsoniter.Marshal(map[interface{}]interface{}{"1": "1", 1: 2, false: 3,})
fmt.Printf("%s - %v\n", a, err)
b, err := json.Marshal(map[interface{}]interface{}{"1": "1", 1: 2, false: 3,})
fmt.Printf("%s - %v\n", b, err)
} output:
|
Could do something like this:
|
@chyroc |
i think or we should add new function |
Just need better support for creating custom types inside of Anko. It is on my to do list. This way don't need to do the type outside of the script. |
Improved make: #302 |
@chyroc Good to close? |
@mattn Close this? |
new map data type is
map[interface {}]interface {}
and
json.Marshal
of"encoding/json"
not support it.two options:
"encoding/json"
to"github.com/json-iterator/go"
, it supportinterface{}
map keyor else better answer?
thank you .
The text was updated successfully, but these errors were encountered: