Skip to content

Instantly share code, notes, and snippets.

@menghan
Last active December 21, 2015 16:59
Show Gist options
  • Select an option

  • Save menghan/6337705 to your computer and use it in GitHub Desktop.

Select an option

Save menghan/6337705 to your computer and use it in GitHub Desktop.
package main
import "fmt"
type Handle interface {
ServeHTTP(c *int, req *int)
}
func NotFound(c *int, req *int) {
}
type HandleFunc func(c *int, req *int)
func (f HandleFunc) ServeHTTP(c *int, req *int) {
f(c, req)
}
type HandleImpl struct {
}
func (hi HandleImpl) ServeHTTP(c *int, req *int) {
}
func main() {
var Handle404 = HandleFunc(NotFound)
var hi HandleImpl
fmt.Printf("%v %v\n", Handle404, hi)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment