blackducksoftware / hub-client-go

Hub Client for Go (golang)
Apache License 2.0
9 stars 19 forks source link

Consider using cleanhttp package to create default HTTP client/transport #51

Open brekelj1 opened 4 years ago

brekelj1 commented 4 years ago

See https://github.com/hashicorp/go-cleanhttp/blob/master/cleanhttp.go

tandr commented 4 years ago

What does it provide? Why do you think this library should be used?

brekelj1 commented 4 years ago

This is because it defines a number of defaults for http.Client and http.Transport that are aligned with the standard go packages: https://github.com/hashicorp/go-cleanhttp/blob/master/cleanhttp.go#L32 (and of course we don't want to use go's global variables http.DefaultClient and http.DefaultTransport because other libraries may modify them, resulting in possible concurrency issues and strange behavior as described in cleanhttp's README.md)