1
0
mirror of https://github.com/golang/go synced 2024-11-20 09:14:46 -07:00

http: give ParseHTTPVersion a real example.

R=rsc
CC=golang-dev
https://golang.org/cl/4239050
This commit is contained in:
David Symonds 2011-03-02 10:10:12 +11:00
parent 60f193781d
commit 1d258a554a

View File

@ -316,7 +316,7 @@ func atoi(s string, i int) (n, i1 int, ok bool) {
} }
// ParseHTTPVersion parses a HTTP version string. // 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) { func ParseHTTPVersion(vers string) (major, minor int, ok bool) {
if len(vers) < 5 || vers[0:5] != "HTTP/" { if len(vers) < 5 || vers[0:5] != "HTTP/" {
return 0, 0, false return 0, 0, false