func (downloader HTTPFileDownloader) GetWithFallback(destination, source string, fallbackSources ...string) error {
	sources := append([]string{source}, fallbackSources...)
	for _, source := range sources {
		err := downloader.Get(destination, source)
		if err != nil {
			log.Errorf("Could not download file from: %s", err)
		} else {
			log.Infof("URL used to download file: %s", source)
			return nil
		}
	}
	return fmt.Errorf("None of the sources returned 200 OK status")
}
GetWithFallback downloads a file from a given source. Provided destination should be a file that does not exist.
You can specify fallback sources which will be used in order if downloading fails from either source.
package filedownloader
import (
	"fmt"
	"io"
	"net/http"
	"os"
	"github.com/bitrise-io/go-utils/log"
)
type HTTPClient interface {
	Get(source string) (*http.Response, error)
}
type HTTPFileDownloader struct {
	client HTTPClient
}
func New(client HTTPClient) HTTPFileDownloader {
	return HTTPFileDownloader{client}
}