<!-- Hello! To ensure this issue is correctly addressed as soon as possible by the IPFS team, please try to make sure: - This issue is relevant to this repository's topic or codebase. - A clear description is provided. It should includes as much relevant information as possible and clear scope for the issue to be actionable. FOR GENERAL DISCUSSION, HELP OR QUESTIONS, please see the options at https://ipfs.io/help or head directly to https://discuss.ipfs.io. (you can delete this section after reading) --> I found in `request.go`: ```go func (r *Request) Send(c *http.Client) (*Response, error) { // snip if resp.StatusCode >= http.StatusBadRequest { // snip io.Copy(ioutil.Discard, resp.Body) resp.Body.Close() } } ``` when developer use `go-ipfs-api`, they typically: ```go // var shells []*shell.Shell = ... connection to a lot of ipfs nodes.. localFile, err := os.Open(localfPath) defer localFile.Close() if err != nil { return nil, err } err = retry.Retry(func(attempt uint) error { response, err = shells[attempt].Add(localFile) if err != nil { return err } return nil }, strategy.Limit(limit), ) ``` So when fail on one shell.add, shell will close the file it pass, it's not good. The close of file should leave to developer.
I found in
request.go:when developer use
go-ipfs-api, they typically:So when fail on one shell.add, shell will close the file it pass, it's not good. The close of file should leave to developer.