Created
December 15, 2016 04:04
-
-
Save jordanorelli/0066db4e45d9ca5b59069cec71a0887c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
) | |
type handler struct { | |
shared string | |
} | |
func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprintf(w, "hi from handler! shared string: %s\n", h.shared) | |
} | |
func main() { | |
h := &handler{shared: "gophers"} | |
http.ListenAndServe(":9000", h) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment