![](/img/trans.png)
[英]json: cannot unmarshal string into Go struct field .result.case_report of type main.CaseReport
我需要解組一個 API 響應,該響應並不總是包含在主結構中定義的某些結構的值。 主要結構如下所示: 上述 json 的內部結構定義為: PrimaryContact 和 CaseReport 返回空是很常見的,當它們返回空時,Go 會拋出錯誤:json cannot unmarshal stri ...