backend, options: Prefer strings.Cut to SplitN
Also realigned the various "split into host🪣prefix"
implementations.
This commit is contained in:
parent
60aa87bbab
commit
65612d797c
9 changed files with 56 additions and 66 deletions
|
@ -127,6 +127,6 @@ func StripPassword(s string) string {
|
|||
}
|
||||
|
||||
func extractScheme(s string) string {
|
||||
data := strings.SplitN(s, ":", 2)
|
||||
return data[0]
|
||||
scheme, _, _ := strings.Cut(s, ":")
|
||||
return scheme
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue