From c4c273888446b4beb215cafc165ecd9365bee357 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Mon, 31 Jan 2022 12:00:19 +0530 Subject: added error handling for GetAnimeById --- anime/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'anime/util.go') diff --git a/anime/util.go b/anime/util.go index f09f189..34ba863 100644 --- a/anime/util.go +++ b/anime/util.go @@ -36,7 +36,7 @@ func requestHandler(token string, endpoint string) string { } func urlGenerator(baseUrl string, names []string, values [][]string, isPrimary bool) (string, error) { - // TODO: error if cap(names) != cap(values) + // length of names and values should be same if cap(names) != cap(values) { return "", errors.New("urlGenerator: Error: Length of names and values don't match.") } @@ -50,7 +50,7 @@ func urlGenerator(baseUrl string, names []string, values [][]string, isPrimary b * else it is &nextkey=value */ if isPrimary { data = "?" + name + "=" - } else { + } else { data = "&" + name + "=" } -- cgit v1.2.3