<commit_before>package webfw_test

import (
	"net/http"
	"webfw"
	"webfw/context"
	"webfw/controller"
	"webfw/types"
)

type Hello struct {
	controller.Base
}

func NewHello(pattern string) Hello {
	return Hello{controller.New(pattern, types.MethodAll, "")}
}

func (con Hello) Handler(c *context.Context) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		params := webfw.GetParams(c, r)
		d := RenderData{name: params["name"]}

		err := webfw.GetRenderCtx(c, r)(w, d, "hello.tmpl")
		if err != nil {
			webfw.GetLogger(c, r).Print(err)
		}
	}
}

func Example() {
	s := webfw.NewServer()

	dispatcher := s.Dispatcher("/")

	dispatcher.Handle(NewHello("/hello/:name"))
	if err := s.ListenAndServe(); err != nil {
		panic(err)
	}
}

func main() {
	Example()
}<commit_msg>fix the example<commit_after>package webfw_test

import (
	"net/http"
	"webfw"
	"webfw/context"
	"webfw/controller"
	"webfw/types"
)

type Hello struct {
	controller.Base
}

func NewHello(pattern string) Hello {
	return Hello{controller.New(pattern, types.MethodAll, "")}
}

func (con Hello) Handler(c *context.Context) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		params := webfw.GetParams(c, r)
		d := types.RenderData{"name": params["name"]}

		err := webfw.GetRenderCtx(c, r)(w, d, "hello.tmpl")
		if err != nil {
			webfw.GetLogger(c, r).Print(err)
		}
	}
}

func Example() {
	s := webfw.NewServer()

	dispatcher := s.Dispatcher("/")

	dispatcher.Handle(NewHello("/hello/:name"))
	if err := s.ListenAndServe(); err != nil {
		panic(err)
	}
}

func main() {
	Example()
}
{'fraction_non_alphanumeric': 0.173125, 'fraction_numerical': 0.0, 'mean_word_length': 4.266447368421052, 'pattern_counts': {'":': 1, '<': 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': '1149106', 'n_tokens_mistral': 651, 'n_tokens_neox': 628, 'n_words': 126}