For example, here's my code for now:
func getImage(url string) image.Image {
client := resty.New()
proxy := config.K.String("proxy")
if proxy != "" {
client.SetProxy(proxy)
spew.Dump(proxy)
}
imageResp, _ := client.R().Get(url)
data := imageResp.RawBody()
defer data.Close()
image, _, _ := image.Decode(data)
return image
}
I debugged and found out that I get 200 as status code, but when reading the image I got(*errors.errorString)(0xe230b0)(image: unknown format), is there any solution? Thanks!