package inspiro import ( "io/ioutil" "net/http" ) const api = "https://inspirobot.me/api?generate=true" func Generate() (string, error) { resp, err := http.Get(api) if err != nil { return "", err } body, err := ioutil.ReadAll(resp.Body) if err != nil { return "", err } defer resp.Body.Close() return string(body), nil }