<commit_before>package main

import (
	"net/http"
	"text/template"

	"github.com/julienschmidt/httprouter"
)

// ContactContext for Contact Template
type ContactContext struct {
	Title string
	Text  string
	Post  *PostData
}

// PostData
type PostData struct {
	Name    string
	Email   string
	Message string
}

// Contact show the form for the user
func Contact(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	tpl, err := template.ParseFiles("templates/contact.gohtml")

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}

	err = tpl.Execute(w, ContactContext{
		Title: "Contact",
		Text:  "Contact us!",
		Post:  new(PostData),
	})

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}
}

// ContactPost process the form sent by the user
func ContactPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	err := r.ParseForm()

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}

	tpl, err := template.ParseFiles("templates/contact.gohtml")

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}

	post := &PostData{
		Name:    r.PostFormValue("Contact[Name]"),
		Email:   r.PostFormValue("Contact[Email]"),
		Message: r.PostFormValue("Contact[Message]"),
	}

	tpl.Execute(w, ContactContext{
		Title: "Contact Post",
		Text:  "This is your data:",
		Post:  post,
	})
}<commit_msg>Update PostData init and fix typo<commit_after>package main

import (
	"net/http"
	"text/template"

	"github.com/julienschmidt/httprouter"
)

// ContactContext for Contact Template
type ContactContext struct {
	Title string
	Text  string
	Post  *PostData
}

// PostData to store Post Data self explanatory (?)
type PostData struct {
	Name    string
	Email   string
	Message string
}

// Contact show the form for the user
func Contact(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	tpl, err := template.ParseFiles("templates/contact.gohtml")

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}

	err = tpl.Execute(w, ContactContext{
		Title: "Contact",
		Text:  "Contact us!",
		Post:  new(PostData),
	})

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}
}

// ContactPost process the form sent by the user
func ContactPost(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
	err := r.ParseForm()

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}

	tpl, err := template.ParseFiles("templates/contact.gohtml")

	if err != nil {
		w.Write([]byte(err.Error()))
		return
	}

	tpl.Execute(w, ContactContext{
		Title: "Contact Post",
		Text:  "This is your data:",
		Post: &PostData{
			Name:    r.PostFormValue("Contact[Name]"),
			Email:   r.PostFormValue("Contact[Email]"),
			Message: r.PostFormValue("Contact[Message]"),
		},
	})
}
{'fraction_non_alphanumeric': 0.14583333333333334, 'fraction_numerical': 0.0, 'mean_word_length': 3.8271604938271606, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4345409', 'n_tokens_mistral': 993, 'n_tokens_neox': 947, 'n_words': 241}