捕获嵌套接口值

I'm trying to get the values of a json that was obtained by means of a request.

But I'm not getting the value foo1, I've tried everything but I can not get the value.

The invalid operation error appears.

Can you help me?

{
    "result": {
        "foo1": 1751,
        "foo2": "2018-12-17T00:00:00-02:00",
    }
}

url := "mysite"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)

byt := []byte(string(body))

var dat map[string]interface{}

if err := json.Unmarshal(byt, &dat); err != nil {
    panic(err)
}

fmt.Println(dat) //map[result:map[foo1:1751 foo2:2018-12-17T00:00:00-02:00]]
fmt.Println(dat["result"]) //map[foo1:1751 foo2:2018-12-17T00:00:00-02:00]]
foo1  := dat["result"]["foo1"] //invalid operation: dat["result"]["foo1"] (type interface {} does not support indexing)
fmt.Println(foo1)

Elaborating on @zerkms's comment, you need to type assert it to map[string]interface{}. Go playground link

P.S: Performing a nil check before assigning is always a good idea.

if exists := dat["result"]; exists != nil { foo1 := dat["result"].(map[string]interface{}) }