Golang net/http.ParseHTTPVersion() function example
package net/http
Golang net/http.ParseHTTPVersion() function usage example
package main
import (
"fmt"
"net/http"
)
func main() {
fmt.Println("Hello, playground")
major, minor, ok := http.ParseHTTPVersion("HTTP/1.0")
fmt.Printf("major : %d, minor : %d, ok : %v", major, minor, ok)
}
Output :
Hello, playground
major : 1, minor : 0, ok : true
Reference :
Advertisement
Something interesting
Tutorials
+5.8k CodeIgniter/PHP : Remove empty lines above RSS or ATOM xml tag
+35.5k Golang : Smarter Error Handling with strings.Contains()
+21.2k Golang : How to force compile or remove object files first before rebuild?
+13.4k Golang : Get constant name from value
+9.2k nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
+7.2k Golang : Null and nil value
+5.2k Golang : Customize scanner.Scanner to treat dash as part of identifier
+11.7k How to tell if a binary(executable) file or web application is built with Golang?
+15.6k Golang : ROT47 (Caesar cipher by 47 characters) example
+8.6k Golang : Convert(cast) []byte to io.Reader type
+11.6k Golang : Simple file scaning and remove virus example
+41.9k Golang : How do I convert int to uint8?