Skip to content

Commit

Permalink
Using strings.Index instead of strings.SplitN
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Mar 5, 2020
1 parent 6788cfd commit 9de9b87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libbeat/common/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func ParseURL(raw string, hints ...ParseHint) (*url.URL, error) {
hints = append(hints, WithDefaultScheme("http"))
}

if parts := strings.SplitN(raw, "://", 2); len(parts) != 2 {
if strings.Index(raw, "://") == -1 {
for _, hint := range hints {
raw = hint(raw)
}
Expand Down

0 comments on commit 9de9b87

Please sign in to comment.