remove func.go and standardize main file name
This commit is contained in:
parent
5cadfcf78b
commit
4ba62e19c7
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"git.xdrm.io/go/aicra/datatype"
|
||||
)
|
||||
|
@ -163,3 +164,15 @@ func (server *Server) collide() error {
|
|||
|
||||
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
|
||||
}
|
|
@ -3,7 +3,6 @@ package config
|
|||
// cerr allows you to create constant "const" error with type boxing.
|
||||
type cerr string
|
||||
|
||||
// Error implements the error builtin interface.
|
||||
func (err cerr) Error() string {
|
||||
return string(err)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
Loading…
Reference in New Issue