move URL into dedicated folder

This commit is contained in:
aler9
2022-06-05 01:27:19 +02:00
parent 45f5107ae3
commit 2fa3148a27
25 changed files with 123 additions and 102 deletions

15
pkg/url/path.go Normal file
View File

@@ -0,0 +1,15 @@
package url
import (
"strings"
)
// PathSplitQuery splits a path from a query.
func PathSplitQuery(pathAndQuery string) (string, string) {
i := strings.Index(pathAndQuery, "?")
if i >= 0 {
return pathAndQuery[:i], pathAndQuery[i+1:]
}
return pathAndQuery, ""
}