This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| type Node struct { | |
| Value int | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mholt [9:10 AM] | |
| When using http.Get(), is it really necessary to read the full response body just to close it later? | |
| [9:10] | |
| The docs keep saying `Caller should close resp.Body when done reading from it.` and I keep seeing code like this: | |
| ``` | |
| io.Copy(ioutil.Discard, resp.Body) | |
| resp.Body.Close() | |
| ``` |