Added genre lists

This commit is contained in:
2016-11-03 09:01:23 +09:00
parent eacf0e2399
commit 8f3ef01285
6 changed files with 52 additions and 38 deletions

27
helper.go Normal file
View File

@ -0,0 +1,27 @@
package main
import "fmt"
// Converts anything into a string
func s(v interface{}) string {
return fmt.Sprintf("%v", v)
}
// Contains ...
func Contains(list []string, a string) bool {
for _, b := range list {
if b == a {
return true
}
}
return false
}
// Map ...
func Map(original []string, f func(string) string) []string {
mapped := make([]string, len(original))
for index, value := range original {
mapped[index] = f(value)
}
return mapped
}