Skip to content

Instantly share code, notes, and snippets.

@wm
Created November 8, 2015 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wm/21866e628e3900f0ce17 to your computer and use it in GitHub Desktop.
Save wm/21866e628e3900f0ce17 to your computer and use it in GitHub Desktop.
casting-vs-calling-2
package main
import (
"fmt"
"net/http"
)
type Lol struct{}
func (l *Lol) ServeHTTP(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "LOL")
}
func main() {
http.Handle("/lol", &Lol{})
http.ListenAndServe(":3000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment