For this tutorial, we will learn how to unmarshal JSON data retrieved from http.Get() function. Using the HTTP response JSON data tutorial as example, the codes below will grab the JSON data and unmarshal them into struct.

NOTE : This example is also useful ... as a way for you to mock JSON reply to test your API.

The first part, will be the server generating the JSON data. Simple program with static JSON response :

By Adam Ng

IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.