type Response2 struct { method string bc string gc []string}字段的名称必须为大写,否则Json模块将无法访问它们(它们是模块专有的)。您可以使用json标签指定字段和名称之间的匹配项
type Response2 struct { Method string `json:"method"` Bc string `json:"bc"` Gc []string `json:"gc"`}
type Response2 struct { method string bc string gc []string}字段的名称必须为大写,否则Json模块将无法访问它们(它们是模块专有的)。您可以使用json标签指定字段和名称之间的匹配项
type Response2 struct { Method string `json:"method"` Bc string `json:"bc"` Gc []string `json:"gc"`}