package beego import ( "fmt" "html/template" "net/http" "runtime" ) var tpl = ` beego application error
Request Method: {{.RequestMethod}}
Request URL: {{.RequestURL}}
RemoteAddr: {{.RemoteAddr }}
Stack
{{.Stack}}
` func ShowErr(err interface{}, rw http.ResponseWriter, r *http.Request, Stack string) { t, err := template.New("beegoerrortemp").Parse(tpl) data := make(map[string]string) data["AppError"] = AppName + ":" + fmt.Sprint(err) data["RequestMethod"] = r.Method data["RequestURL"] = r.RequestURI data["RemoteAddr"] = r.RemoteAddr data["Stack"] = Stack data["BeegoVersion"] = VERSION data["GoVersion"] = runtime.Version() t.Execute(rw, data) }