aboutsummaryrefslogtreecommitdiff
path: root/anime/util.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@protonmail.ch>2022-01-31 12:00:19 +0530
committerVidhu Kant Sharma <vidhukant@protonmail.ch>2022-01-31 12:00:19 +0530
commitc4c273888446b4beb215cafc165ecd9365bee357 (patch)
tree015e4e59aedc5da9c099f22fd573b7cace38d154 /anime/util.go
parent0dd65dd062362f913b3028e07e2f0c3afaec8894 (diff)
added error handling for GetAnimeById
Diffstat (limited to 'anime/util.go')
-rw-r--r--anime/util.go4
1 files changed, 2 insertions, 2 deletions
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 + "="
}