Skip to content

Commit

Permalink
chore(typo): remove them...
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaraa committed Sep 15, 2024
1 parent be1aa0c commit 2c49208
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func main() {
m.AddFuncRegexp(regexp.MustCompile("^(application|text)/(x-)?(java|ecma)script$"), js.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]json$"), json.Minify)
m.AddFuncRegexp(regexp.MustCompile("[/+]xml$"), xml.Minify)
appHandler := http.NewServeMux()

appHandler := http.NewServeMux()
appHandler.HandleFunc("/", handleHomePage)
appHandler.HandleFunc("/projects", handleProjectsPage)
appHandler.HandleFunc("/xp", handleXpPage)
Expand All @@ -63,8 +63,8 @@ func main() {
timer.Stop()
}

func handelErrorPage(w http.ResponseWriter, r *http.Request) {
log.Errorf("Error happended when calling: %s %s?%s\n", r.Method, r.URL.Path, r.URL.Query().Encode())
func handleErrorPage(w http.ResponseWriter, r *http.Request) {
log.Errorf("Error happened when calling: %s %s?%s\n", r.Method, r.URL.Path, r.URL.Query().Encode())
page := tmplrndr.NewError().Render(tmplrndr.ErrorProps{})
_, _ = io.Copy(w, page)
}
Expand All @@ -86,7 +86,7 @@ func handleHomePage(w http.ResponseWriter, r *http.Request) {
info, err := data.GetInfo()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}
page := tmplrndr.NewIndex().Render(tmplrndr.IndexProps{
Expand All @@ -97,15 +97,15 @@ func handleHomePage(w http.ResponseWriter, r *http.Request) {
_, err = io.Copy(w, page)
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
}
}

func handleProjectsPage(w http.ResponseWriter, r *http.Request) {
pgs, err := data.GetProjectGroups()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}
var viewGroups []tmplrndr.ProjectGroup
Expand Down Expand Up @@ -145,21 +145,21 @@ func handleProjectsPage(w http.ResponseWriter, r *http.Request) {
_, err = io.Copy(w, page)
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
}
}

func handleXpPage(w http.ResponseWriter, r *http.Request) {
work, err := data.GetWorkXP()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}
vol, err := data.GetVolunteeringXP()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}

Expand Down Expand Up @@ -217,15 +217,15 @@ func handleXpPage(w http.ResponseWriter, r *http.Request) {
_, err = io.Copy(w, page)
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
}
}

func handleAboutPage(w http.ResponseWriter, r *http.Request) {
info, err := data.GetInfo()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}

Expand All @@ -236,7 +236,7 @@ func handleAboutPage(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
_, err = io.Copy(w, page)
if err != nil {
handelErrorPage(w, r)
handleErrorPage(w, r)
log.Errorln(err)
}
}
Expand All @@ -245,14 +245,14 @@ func handleBlogsPage(w http.ResponseWriter, r *http.Request) {
blogs, err := data.GetBlogs()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return

}
info, err := data.GetInfo()
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}

Expand All @@ -274,7 +274,7 @@ func handleBlogsPage(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
_, err = io.Copy(w, page)
if err != nil {
handelErrorPage(w, r)
handleErrorPage(w, r)
log.Errorln(err)
}
}
Expand All @@ -284,7 +284,7 @@ func handleBlogPostPage(w http.ResponseWriter, r *http.Request) {
blog, err := data.GetBlogByPublicId(blogId)
if err != nil {
log.Errorln(err)
handelErrorPage(w, r)
handleErrorPage(w, r)
return
}

Expand All @@ -306,6 +306,6 @@ func handleBlogPostPage(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
_, err = io.Copy(w, page)
if err != nil {
handelErrorPage(w, r)
handleErrorPage(w, r)
}
}

0 comments on commit 2c49208

Please sign in to comment.