func readFromHTTP(targetURL *url.URL) (string, error) {
	var client http.Client
	resp, err := client.Get(targetURL.String())
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	if resp.StatusCode == http.StatusOK {
		bytes, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			return "", err
		}
		return string(bytes), nil
	}
	return "", fmt.Errorf("could not fetch data from %s", targetURL.String())
}
func readFromHTTP(targetURL *url.URL) (string, error) {
	var client http.Client
	resp, err := client.Get(targetURL.String())
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	if resp.StatusCode == http.StatusOK {
		bytes, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			return "", err
		}
		return string(bytes), nil
	}
	return "", fmt.Errorf("could not fetch data from %s", targetURL.String())
}
func readFromHTTP ( targetURL * url . URL ) ( string , error ) { var client http . Client resp , err := client . Get ( targetURL . String ( ) ) if err != nil { return " " , err } defer resp . Body . Close ( ) if resp . StatusCode == http . StatusOK { bytes , err := ioutil . ReadAll ( resp . Body ) if err != nil { return " " , err } return string ( bytes ) , nil } return " " , fmt . Errorf ( " " , targetURL . String ( ) ) }
// readFromHTTP reads file from a http url
// it's up the caller to make sure sourcePath has been tested against
// url.ParseRequestURI()
readFromHTTP reads file from a http url it s up the caller to make sure sourcePath has been tested against url . ParseRequestURI ()