mirror of
https://github.com/golang/go
synced 2024-11-20 09:34:52 -07:00
http: give ParseHTTPVersion a real example.
R=rsc CC=golang-dev https://golang.org/cl/4239050
This commit is contained in:
parent
60f193781d
commit
1d258a554a
@ -316,7 +316,7 @@ func atoi(s string, i int) (n, i1 int, ok bool) {
|
||||
}
|
||||
|
||||
// ParseHTTPVersion parses a HTTP version string.
|
||||
// "HTTP/1.2" returns (1, 2, true).
|
||||
// "HTTP/1.0" returns (1, 0, true).
|
||||
func ParseHTTPVersion(vers string) (major, minor int, ok bool) {
|
||||
if len(vers) < 5 || vers[0:5] != "HTTP/" {
|
||||
return 0, 0, false
|
||||
|
Loading…
Reference in New Issue
Block a user