package test import ( "encoding/json" "fmt" "testing" ) func Test_json(t *testing.T) { articleStrings := `{ "clientID": "869023065073597", "msgID": "24152", "paramsb": { "typeCode": "123", "typeCode2": "123" }, "paramslist": [{ "typeCode": "123", "typeCode2": "123" }], "params": [{ "typeCode": "123", "typeCode2": "123", "varData": [{ "name": "TempSet", "value": "27" }] }] }` var articleSlide map[string]interface{} multiErr := json.Unmarshal([]byte(articleStrings), &articleSlide) if multiErr != nil { fmt.Println("转换出错:", multiErr) } println("articleSlide:", articleSlide) }