Middlewares and some string util functions refactored. Added partial Documentation.

This commit is contained in:
Musab Gültekin
2019-06-16 10:38:03 +03:00
parent 40f673f2e2
commit 80383ebd6f
12 changed files with 219 additions and 152 deletions

19
internal/strings.go Normal file
View File

@ -0,0 +1,19 @@
package internal
// PreferFirst returns first non-empty string
func PreferFirst(first string, second string) string {
if first != "" {
return first
}
return second
}
// Contains checks whether []string Contains string
func Contains(s []string, e string) bool {
for _, a := range s {
if a == e {
return true
}
}
return false
}