Getting a value from http request

I'm trying to get a value for example "id" from this site:

this is my code:

url := fmt.Sprintf(" 
resp, err := http.Get(url)

and then I do:

body, err := ioutil.ReadAll(resp.Body)

and then:

sb := string(body)

so if I want to print the stuff from the website:


and I get the following output:

    "Name": "Catalysm",
    "Id": 7585110,
    "Owner": {
        "Name": "Scypno",
        "Id": 1590107797
    "EmblemUrl": "",
    "Description": "",
    "Roles": [{
        "Name": "Member",
        "Rank": 1
    }, {
        "Name": "Admin",
        "Rank": 254
    }, {
        "Name": "Owner",
        "Rank": 255

but I want to make a variable named "id" to get the following output:


is that possible? and if so, how?

Read more here:

Content Attribution

This content was originally published by Kaitholen at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: