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
package map1 import ( "testing" "reflect" "fmt" "encoding/json" ) func Test2JSON(t *testing.T){ cmap := NewConcurrentMap(reflect.TypeOf(string("")), reflect.TypeOf(string(""))) cmap.Put("k1", "v1") fmt.Printf("%v\n", cmap) bytes, err := json.Marshal(cmap) // 无法将内部数据转成 JSON if err == nil { fmt.Println(string(bytes)) }else { fmt.Printf("err = %v\n",err) } }
C:/Go\bin\go.exe test -v basic/map1 -run ^Test2JSON$ ConcurrentMap<string,string>{k1:v1} {} ok basic/map1 0.234s
The text was updated successfully, but these errors were encountered:
需要修改String方法 原版是为了友好打印的
Sorry, something went wrong.
No branches or pull requests
C:/Go\bin\go.exe test -v basic/map1 -run ^Test2JSON$
ConcurrentMap<string,string>{k1:v1}
{}
ok basic/map1 0.234s
The text was updated successfully, but these errors were encountered: