move util

This commit is contained in:
Asim Aslam
2020-10-17 21:18:59 +01:00
parent 2ecd049871
commit 07b32ad3b9
2 changed files with 21 additions and 38 deletions

21
api/util.go Normal file
View File

@@ -0,0 +1,21 @@
package api
import (
"strings"
)
func strip(s string) string {
return strings.TrimSpace(s)
}
func slice(s string) []string {
var sl []string
for _, p := range strings.Split(s, ",") {
if str := strip(p); len(str) > 0 {
sl = append(sl, strip(p))
}
}
return sl
}