-
Notifications
You must be signed in to change notification settings - Fork 317
Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels