From c22e4d73bd63db779b0c9c344d9fe813523c30f6 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sun, 17 Oct 2021 17:47:56 +0200 Subject: [PATCH] also return error --- pkg/api/aiden/aiden.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/api/aiden/aiden.go b/pkg/api/aiden/aiden.go index 866cc04..a37f700 100644 --- a/pkg/api/aiden/aiden.go +++ b/pkg/api/aiden/aiden.go @@ -8,11 +8,11 @@ import ( log "github.com/sirupsen/logrus" ) -func ApiCall(uri string) string { +func ApiCall(uri string) (string, error) { resp, err := http.Get(fmt.Sprintf("https://customapi.aidenwallis.co.uk/%s", uri)) if err != nil { log.Error(err) - return "Something went wrong FeelsBadMan" + return "Something went wrong FeelsBadMan", err } defer resp.Body.Close() @@ -20,7 +20,7 @@ func ApiCall(uri string) string { body, err := ioutil.ReadAll(resp.Body) if err != nil { log.Error(err) - return "Something went wrong FeelsBadMan" + return "Something went wrong FeelsBadMan", err } - return string(body) + return string(body), nil }