Golang MVC
main.go
package main import ( "net/http" ) func main() { router := newRouter() http.ListenAndServe(":9000", router) } ==router.go== <pre> package main import ( "net/http" ) func router() *http.ServeMux { router := http.NewServeMux() router.HandleFunc("/", start) return router }
controller.go
package main import ( "fmt" "net/http" ) func start(h http.ResponseWriter, r * http.Request) { fmt.Fprint(h,"Thorsten"); }