package repo import ( "html/template" "net/http" ) type repository struct { Name string } var vanityTemplate = template.Must(template.New("code").Parse(` `)) func init() { http.HandleFunc("/", handleTransactions) } func handleTransactions(w http.ResponseWriter, r *http.Request) { repoName := r.URL.Path p := &repository{Name: repoName} if err := vanityTemplate.Execute(w, p); err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } }