refactor-test #15

Merged
xdrm-brackets merged 12 commits from refactor-test into 0.3.0 2020-04-04 15:33:44 +00:00
3 changed files with 13 additions and 16 deletions
Showing only changes of commit 4ba62e19c7 - Show all commits

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"io" "io"
"net/http" "net/http"
"strings"
"git.xdrm.io/go/aicra/datatype" "git.xdrm.io/go/aicra/datatype"
) )
@ -163,3 +164,15 @@ func (server *Server) collide() error {
return nil return nil
} }
// SplitURL without empty sets
func SplitURL(url string) []string {
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
}

View File

@ -3,7 +3,6 @@ package config
// cerr allows you to create constant "const" error with type boxing. // cerr allows you to create constant "const" error with type boxing.
type cerr string type cerr string
// Error implements the error builtin interface.
func (err cerr) Error() string { func (err cerr) Error() string {
return string(err) return string(err)
} }

View File

@ -1,15 +0,0 @@
package config
import "strings"
// SplitURL without empty sets
func SplitURL(url string) []string {
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
}