move url.URL into base.URL (#459)

This commit is contained in:
Alessandro Ros
2023-11-07 16:51:45 +01:00
committed by GitHub
parent b8838ca595
commit 01b3bfc6ab
44 changed files with 268 additions and 259 deletions

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

@@ -0,0 +1,15 @@
package base
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, ""
}