Skip to content

Instantly share code, notes, and snippets.


xguox/main.go Secret

Last active Jan 22, 2019
What would you like to do?
package main
import (
_ "net/http/pprof"
func main() {
http.Handle("/", &MyHandler{})
http.Handle("/hello", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
http.HandleFunc("/ping", hello)
http.ListenAndServe(":8080", nil)
func hello(w http.ResponseWriter, r *http.Request) {
type MyHandler struct{}
func (m *MyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("MyHandler ServeHTTP"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.