NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
[TOC] ## 定义一个结构体 ``` type configType struct { Enabled bool `json:"enabled"` Buffer int `json:"buffer"` AppKey string `json:"appkey"` MasterSecret string `json:"masterSecret"` ApiUrl string `json:"apiUrl"` Platform []string `json:"Platform"` } ``` ## struct 转json ``` ``` ## json 转 struct ``` pushConfig := "" if err := json.Unmarshal([]byte(jPushConfig), &config); err !=nil { logger.Logger.Error("jPushConfig json parse error") return nil } ```