Config Array Syntax (#8204)

* refactor util encryption library so it doesn't have to import log

* add util.SplitString to handle space and/or comma-separated config lines

* go fmt
This commit is contained in:
Dan Cech
2017-04-25 09:14:29 +02:00
committed by Torkel Ödegaard
parent d085aaad41
commit b489e93d94
11 changed files with 80 additions and 27 deletions
+12
View File
@@ -1,5 +1,9 @@
package util
import (
"regexp"
)
func StringsFallback2(val1 string, val2 string) string {
return stringsFallback(val1, val2)
}
@@ -16,3 +20,11 @@ func stringsFallback(vals ...string) string {
}
return ""
}
func SplitString(str string) []string {
if len(str) == 0 {
return []string{}
}
return regexp.MustCompile("[, ]+").Split(str, -1)
}