Test out some pattern-matching syntax
This commit is contained in:
1 parent
a4bf9c140f
commit
b0fda7e317
1 file changed
+5
-2
@@ -5,8 +5,11 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("Hello, World!"))
|
||||
http.HandleFunc("GET /", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("This was a GET request!"))
|
||||
})
|
||||
http.HandleFunc("POST /", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("This was a POST request!"))
|
||||
})
|
||||
http.ListenAndServe(":8000", nil)
|
||||
}
|
||||
Reference in new issue
Block a user