package main import ( "encoding/json" "fmt" "reflect" ) type Info struct { // 结构体的字段,首字母必须大写,否则序列化时读取不到 Title string Count int } type Address struct { // 想要序列化后的字段为小写,可以在结构体中写tag实现 City string `json:"city"` Num int
Marshal func Marshal(v interface{})([]byte, error) Marshal returns the JSON encoding of v. Marshal返回v的JSON编码. Marshal traverses the value v recursively. If an encountered value implements the Marshaler interface and is not a nil pointer, Marshal call
//aa='{"id":0,"appId":"app***********Id","appSecret":"appSexxxxxxxxxrcret","addBalance":111,"updateTime":0}'; var b = JSON.parse(aa); //将字符串类型的json字符串转换对json对象 var c=$.parseJSON(aa); //