go字符串转map
package main import ( "encoding/json" "fmt" "reflect" ) func main() { resString := ` { "access_token": "47_qIFirLMuWsDXVBWbUCRqWa8LnHku4L2oIALxb29p3j6adkk1L542LuhEHD2En9cXCRvCBUS" }` var resMap map[string]interface{} err := json.Unmarshal([]byte(resString), &resMap) if err != nil { fmt.Println("string转map失败", err) } fmt.Println("args取值", resMap["access_token"], reflect.TypeOf(resMap["access_token"])) }