We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
m := linkedhashmap.New[int, string]() // empty (keys are of type int) m.Put(4, "d") // 2->b m.Put(2, "b") // 2->b m.Put(1, "x") // 2->b, 1->x (insertion-order) m.Put(1, "a") // 2->b, 1->a (insertion-order) { //marshalJSON, err2 := m.MarshalJSON() //fmt.Println("marshalJSON", string(marshalJSON), err2) toJSON, err := m.ToJSON() fmt.Println("toJSON", string(toJSON), err) } { marshal, err := json.Marshal(m) fmt.Println("json编码", string(marshal), err) [linkedhashmap](json: error calling MarshalJSON for type *linkedhashmap.Map[int,string]: invalid character '4' looking for beginning of object key string) }
The text was updated successfully, but these errors were encountered:
这里的问题是linkedhashmap的MarshalJSON接口的实现是错误的,不满足JSON格式: 你得修改对应的实现
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: