mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net: reject invalid net:proto network names
R=rsc CC=golang-dev https://golang.org/cl/4129042
This commit is contained in:
parent
acad4e0cf9
commit
df4b22fcff
3 changed files with 19 additions and 23 deletions
|
|
@ -192,16 +192,6 @@ func count(s string, b byte) int {
|
|||
return n
|
||||
}
|
||||
|
||||
// Returns the prefix of s up to but not including the character c
|
||||
func prefixBefore(s string, c byte) string {
|
||||
for i, v := range s {
|
||||
if v == int(c) {
|
||||
return s[0:i]
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// Index of rightmost occurrence of b in s.
|
||||
func last(s string, b byte) int {
|
||||
i := len(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue