问题 1:
json 中的时间格式不标准"create_time":"2021-08-14 11:36:37"
在转为 struct 时,不能直接转为 time.Time 。
网上找了别人写好的 UnmarshalJSON 方法,依然不能解析。
问题 2:
将 struct 改为 string,输出是空。
在 go 中,json.Unmarshal 解析前的代码是 bytes 数组。手动执行 curl,得到的结果是有的。
json 中的时间格式不标准"create_time":"2021-08-14 11:36:37"
在转为 struct 时,不能直接转为 time.Time 。
网上找了别人写好的 UnmarshalJSON 方法,依然不能解析。
问题 2:
将 struct 改为 string,输出是空。
在 go 中,json.Unmarshal 解析前的代码是 bytes 数组。手动执行 curl,得到的结果是有的。