aboutsummaryrefslogtreecommitdiff
path: root/anime/validators.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/validators.go
parent0dd65dd062362f913b3028e07e2f0c3afaec8894 (diff)
added error handling for GetAnimeById
Diffstat (limited to 'anime/validators.go')
-rw-r--r--anime/validators.go10
1 files changed, 4 insertions, 6 deletions
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
}