Hello I am starting to learn Go.
I have been exploring this language and started to fetch some APIs and faced an issue fetching an URL that returns csv file.
On my log appears two weird symbols, can someone help me with that?
Maybe I am not fetching right when type is CSV.
package main
import (
"io/ioutil"
"log"
"net/http"
)
func main(){
resp, err := http.Get("http://api.tradingeconomics.com/fred/historical/BAMLC0A1CAAAEY?c=guest:guest&d1=2017-05-01&d2=2019-01-01&f=csv")
if err != nil {
log.Fatalln(err)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
log.Println(string("RESULT:"))
log.Println(string(body))
}
Result: