2020-03-14 23:27:54 +00:00
|
|
|
package config
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
2020-03-16 08:26:10 +00:00
|
|
|
// SplitURL without empty sets
|
|
|
|
func SplitURL(url string) []string {
|
2020-03-14 23:27:54 +00:00
|
|
|
trimmed := strings.Trim(url, " /\t\r\n")
|
|
|
|
split := strings.Split(trimmed, "/")
|
|
|
|
|
|
|
|
// remove empty set when empty url
|
|
|
|
if len(split) == 1 && len(split[0]) == 0 {
|
|
|
|
return []string{}
|
|
|
|
}
|
|
|
|
return split
|
|
|
|
}
|