func saveNewsToFile(filename string, url string) {
	responseData := getHttpResponse(url)
	if responseData == nil {
		return
	}
	newsOutputPath := "privatedata/news/" + filename + ".json"
	err := ioutil.WriteFile(newsOutputPath, responseData, 0666)
	if err != nil {
		fmt.Println(err)
	}
}
fetches and saves a single source of news
@param url to fetch JSON of articles from a single news provider
package gostuff
import (
	"bufio"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strings"
)
type NewsProviders struct {
	Status  string
	Sources []NewsSources
}
type NewsSources struct {
	ID              string
	Name            string
	Description     string
	Url             string
	Category        string
	Language        string
	Country         string
	UrlToLogos      []UrlToLogo
	SortByAvailable []string
}
type UrlToLogo struct {
	Small  string
	Medium string
	Large  string
}
type AllNewsProviders struct {
	PageTitle string
	Providers []NewsProvider
}
type NewsProvider struct {
	Status   string
	Source   string
	Sortby   string
	Articles []NewsArticle
}
type NewsArticle struct {
	Author      string
	Title       string
	Description string
	Url         string
	UrlToImage  string
	PublishedAt string
}
func FetchNewsSources() {
	const (
		newsSourceList = "https://newsapi.org/v1/sources?language=en"
	)
	logFile, _ := os.OpenFile("logs/errors.txt", os.O_APPEND|os.O_WRONLY, 0666)
	defer logFile.Close()
	log := log.New(logFile, "", log.LstdFlags|log.Lshortfile)
	client := TimeOutHttp(5)
	response, err := client.Get(newsSourceList)
	if response == nil {
		log.Println("FetchNewsSources URL time out for ", newsSourceList)
		return
	}
	if err != nil {
		log.Println(err)
		return
	}
	defer response.Body.Close()
	responseData, err := ioutil.ReadAll(response.Body)
	if err != nil {
		log.Println(err)
	}
	var newsProviders NewsProviders
	if err := json.Unmarshal(responseData, &newsProviders); err != nil {
		log.Println("Just receieved a message I couldn't decode in news.go FetchNewsSources 1:", string(responseData), err)
		return
	}
	apiKey := getApiKey()
	for _, source := range newsProviders.Sources {
		url := "https://newsapi.org/v1/articles?source=" + source.ID + "&apiKey=" + apiKey
		saveNewsToFile(source.ID, url)
	}
}