code: func NewClientWithOpts(ops ...Opt) (*Client, error) {
  	client, err := defaultHTTPClient(DefaultDockerHost)
  	if err != nil {
  		return nil, err
  	}
  	c := &Client{
  		host:    DefaultDockerHost,
  		version: api.DefaultVersion,
  		client:  client,
  		proto:   defaultProto,
  		addr:    defaultAddr,
  	}
  
  	for _, op := range ops {
  		if err := op(c); err != nil {
  			return nil, err
  		}
  	}
  
  	if _, ok := c.client.Transport.(http.RoundTripper); !ok {
  		return nil, fmt.Errorf("unable to verify TLS configuration, invalid transport %v", c.client.Transport)
  	}
  	if c.scheme == "" {
  		c.scheme = "http"
  
  		tlsConfig := resolveTLSConfig(c.client.Transport)
  		if tlsConfig != nil {
  			// TODO(stevvooe): This isn't really the right way to write clients in Go.
  			// `NewClient` should probably only take an `*http.Client` and work from there.
  			// Unfortunately, the model of having a host-ish/url-thingy as the connection
  			// string has us confusing protocol and transport layers. We continue doing
  			// this to avoid breaking existing clients but this should be addressed.
  			c.scheme = "https"
  		}
  	}
  
  	return c, nil
  }
docs: // NewClientWithOpts initializes a new API client with default values. It takes functors
  // to modify values when creating it, like `NewClientWithOpts(WithVersion(…))`
  // It also initializes the custom http headers to add to each request.
  //
  // It won't send any version information if the version number is empty. It is
  // highly recommended that you set a version or your client may break if the
  // server is upgraded.