Skip to content

Instantly share code, notes, and snippets.

@jordanorelli
Created December 15, 2016 04:04
Show Gist options
  • Save jordanorelli/0066db4e45d9ca5b59069cec71a0887c to your computer and use it in GitHub Desktop.
Save jordanorelli/0066db4e45d9ca5b59069cec71a0887c to your computer and use it in GitHub Desktop.
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