Closed

Description
net.Resolver in currently allows the following (ignoring #24330):
var r *net.Resolver
fmt.Println(r.LookupHost(context.Background(), "example.com"))
Note that nil *Resolver is equivalent to the zero Resolver.
I propose that using the nil net/http.*Client also be permitted. This is useful when allowing callers to specify a *Client to use for HTTP operations:
type Config struct {
Client *http.Client
}
func (c *Config) Get() {
resp, err := c.Client.Get("https://example.com")
// Rather than:
client := c.Client
if client == nil {
client = http.DefaultClient
}
resp, err := client.Get("https://example.com")
}