code: func ParseHost(defaultToTLS, defaultToUnixXDG bool, val string) (string, error) {
  	host := strings.TrimSpace(val)
  	if host == "" {
  		if defaultToTLS {
  			host = DefaultTLSHost
  		} else if defaultToUnixXDG {
  			runtimeDir, err := homedir.GetRuntimeDir()
  			if err != nil {
  				return "", err
  			}
  			socket := filepath.Join(runtimeDir, "docker.sock")
  			host = "unix://" + socket
  		} else {
  			host = DefaultHost
  		}
  	} else {
  		var err error
  		host, err = parseDaemonHost(host)
  		if err != nil {
  			return val, err
  		}
  	}
  	return host, nil
  }
docs: // ParseHost and set defaults for a Daemon host string.
  // defaultToTLS is preferred over defaultToUnixXDG.