'How to handle different JSONs in Golang? [duplicate]
I am a novice developer and faced such a problem, I can receive a json which in some cases has different data, for example
Example 1:
{
"orderDescription": "Apple",
}
Example 2:
"order_description":
{
"customerEmail":"[email protected]",
"additionalInfo":"Apple"
},
Do I need to create a structure for every possible answer? Or is there a generic solution.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|