backend, options: Prefer strings.Cut to SplitN

Also realigned the various "split into host🪣prefix"
implementations.
This commit is contained in:
greatroar 2022-11-27 18:09:59 +01:00 committed by Michael Eischer
parent 60aa87bbab
commit 65612d797c
9 changed files with 56 additions and 66 deletions

View file

@ -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
}