New companies page

This commit is contained in:
2018-03-23 19:04:06 +01:00
parent 1cb4d1377d
commit 89f745ee2e
5 changed files with 51 additions and 18 deletions

12
utils/MaxAnime.go Normal file
View File

@ -0,0 +1,12 @@
package utils
import "github.com/animenotifier/arn"
// MaxAnime limits the number of anime that will maximally be returned.
func MaxAnime(animes []*arn.Anime, maxLength int) []*arn.Anime {
if len(animes) > maxLength {
return animes[:maxLength]
}
return animes
}