func (allArticles *AllNewsProviders) ReadAllNews() {
	const newsConfigPath = "privatedata/newsConfig.txt"
	config, err := os.Open(newsConfigPath)
	defer config.Close()
	if err != nil {
		fmt.Println("news.go ReadAllNews 0", err)
		return
	}
	allArticles.PageTitle = "News"
	scanner := bufio.NewScanner(config)
	for scanner.Scan() {
		fileName := scanner.Text()
		var newsProvider NewsProvider
		success := newsProvider.getNewsFromFile("privatedata/news/" + fileName + ".json")
		if success == false {
			fmt.Println("error reading news source for ", fileName)
		}
		newsProvider.convertToHttps()
		allArticles.Providers = append(allArticles.Providers, newsProvider)
	}
}
reads all news from all files that are listed in a textfile
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)
	}
}
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)
	}
}
func getHttpResponse(url string) []byte {
	client := TimeOutHttp(5)
	response, err := client.Get(url)
	if err != nil {
		fmt.Println("getHttpResponse 0", err)
		return nil
	}
	defer response.Body.Close()
	responseData, err := ioutil.ReadAll(response.Body)
	if err != nil {
		fmt.Println("getHttpResponse 1", err)
		return nil
	}
	return responseData
}