Closed
Description
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version
)?
go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
Yes
Describe the issue
In a recent topic on golang-nuts (https://groups.google.com/forum/#!topic/golang-nuts/JmpHoAd76aU) the user reported how hard is to set safe defaults on a custom Transport.
-
New fields may be added in future releases, and have custom (not zero) default value set for DefaultTransport.
-
Using a function to copy exported fields (like https://play.golang.org/p/cotZaihUxdi) may cause problems.
I think that the documentation of Transport should document this issue. Is it safe to copy the exported fields of a Transport?
If this cannot be guaranteed, the http package should export a new function, like NewTransportWithDefaults.