This question already has an answer here:
I'm new to Go. If I'm doing an HTTP get request let this:
resp, err := http.Get("https://www.google.com")
Now I need to check whether err
is nil and defer resp.Body.Close()
. What's the correct order to do these two operations?
</div>