From c8053d860c703736f98bd17a1aec154e04364cfa Mon Sep 17 00:00:00 2001 From: Nick White Date: Wed, 21 Mar 2018 18:57:55 +0000 Subject: Document why http.Get isnt used --- weather.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weather.go b/weather.go index 161fd7b..7ca592e 100644 --- a/weather.go +++ b/weather.go @@ -41,10 +41,9 @@ func main() { id = defid } - tr := &http.Transport{} - client := &http.Client{Transport: tr} + // Use http.Client.Get as http.Get doesn't seem to handle TLS + client := &http.Client{Transport: &http.Transport{}} resp, err := client.Get("https://www.metoffice.gov.uk/public/data/PWSCache/BestForecast/Forecast/" + id + ".json?concise=true") - //resp, err := http.Get("https://www.metoffice.gov.uk/public/data/PWSCache/BestForecast/Forecast/" + id + ".json?concise=true") if err != nil { log.Fatal(err) } -- cgit v1.2.3