Rename rw, req to w, r

This commit is contained in:
adnano
2020-10-13 20:22:12 -04:00
parent 67842c6425
commit faf94d8ba5
4 changed files with 81 additions and 81 deletions

12
doc.go
View File

@@ -64,14 +64,14 @@ Servers must be configured with certificates:
Servers can accept requests for multiple hosts and schemes:
server.HandleFunc("example.com", func(rw *gmi.ResponseWriter, req *gmi.Request) {
fmt.Fprint(rw, "Welcome to example.com")
server.HandleFunc("example.com", func(w *gmi.ResponseWriter, r *gmi.Request) {
fmt.Fprint(w, "Welcome to example.com")
})
server.HandleFunc("example.org", func(rw *gmi.ResponseWriter, req *gmi.Request) {
fmt.Fprint(rw, "Welcome to example.org")
server.HandleFunc("example.org", func(w *gmi.ResponseWriter, r *gmi.Request) {
fmt.Fprint(w, "Welcome to example.org")
})
server.HandleSchemeFunc("http", "example.net", func(rw *gmi.ResponseWriter, req *gmi.Request) {
fmt.Fprint(rw, "Proxied content from example.net")
server.HandleSchemeFunc("http", "example.net", func(w *gmi.ResponseWriter, r *gmi.Request) {
fmt.Fprint(w, "Proxied content from example.net")
})
To start the server, call ListenAndServe: