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/validators.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'anime/validators.go') diff --git a/anime/validators.go b/anime/validators.go index 3f66abe..4cf4986 100644 --- a/anime/validators.go +++ b/anime/validators.go @@ -12,14 +12,13 @@ func isValidRankingType(rankingType string) bool { "movie", "special", "bypopularity", - "favorite": - return true + "favorite": return true } return false } // Checks if given rankingType is valid -func areValidFields(field string) bool { +func isValidField(field string) bool { switch field { case "id", @@ -45,7 +44,7 @@ func areValidFields(field string) bool { "start_season", "broadcast", "source", - "avarage_episode_duration", + "average_episode_duration", "rating", "pictures", "background", @@ -53,8 +52,7 @@ func areValidFields(field string) bool { "related_manga", "recommendations", "studios", - "statistics": - return true + "statistics": return true } return false } -- cgit v1.2.3