code: func ParseHostURL(host string) (*url.URL, error) {
  	protoAddrParts := strings.SplitN(host, "://", 2)
  	if len(protoAddrParts) == 1 {
  		return nil, fmt.Errorf("unable to parse docker host `%s`", host)
  	}
  
  	var basePath string
  	proto, addr := protoAddrParts[0], protoAddrParts[1]
  	if proto == "tcp" {
  		parsed, err := url.Parse("tcp://" + addr)
  		if err != nil {
  			return nil, err
  		}
  		addr = parsed.Host
  		basePath = parsed.Path
  	}
  	return &url.URL{
  		Scheme: proto,
  		Host:   addr,
  		Path:   basePath,
  	}, nil
  }
docs: // ParseHostURL parses a url string, validates the string is a host url, and
  // returns the parsed URL