Thank you for your comments.
I was studying this link: https://golang.org/doc/articles/wiki/
At the end it give us some challenges and I am trying to implement the latest one, that consist to change wiki page text links to another page to the correct html tag.
That was the only way I found to accomplish it. Probably there is better way to solves it, that is why I am asking you experts to advice me. 
That is my template view.html
:
<html>
<head>
<title>View Page</title>
</head>
<body>
<h1>{{.Title}}</h1>
<p>[<a href="/edit/{{.Title}}">edit</a>]</p>
<div>{{range .Lines}}{{ . }}<br/>{{end}}</div>
</body>
</html>
Template edit.html
:
<html>
<head>
<title>Edit Page</title>
</head>
<body>
<h1>Editing {{.Title}}</h1>
<form action="/save/{{.Title}}" method="POST">
<div><textarea name="body" rows="20" cols="80">{{printf "%s" .Body}}</textarea></div>
<div><input type="submit" value="Save"></div>
</form>
</body>
</html>
That is my entire code (it is long, sorry!):
package main
import (
"bytes"
"html/template"
"io"
"io/ioutil"
"net/http"
"path/filepath"
"regexp"
"strings"
)
const (
templatePath = "tmpl"
dataPath = "data"
)
var (
templates = template.Must(template.ParseFiles(
filepath.Join(templatePath, "edit.html"),
filepath.Join(templatePath, "view.html"),
))
validPath = regexp.MustCompile("^/(edit|save|view)/([a-zA-Z0-9]+)$")
validLink = regexp.MustCompile("\\[([a-zA-Z0-9]+)\\]")
)
func main() {
http.HandleFunc("/view/", makeHandler(viewHandler))
http.HandleFunc("/edit/", makeHandler(editHandler))
http.HandleFunc("/save/", makeHandler(saveHandler))
http.HandleFunc("/", handler)
http.ListenAndServe(":8080", nil)
}
func makeHandler(fn func(http.ResponseWriter, *http.Request, string)) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// Here we will extract the page title from the Request,
// and call the provided handler 'fn'
m := validPath.FindStringSubmatch(r.URL.Path)
if m == nil {
http.NotFound(w, r)
return
}
fn(w, r, m[2])
}
}
func handler(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/view/FrontPage", http.StatusFound)
}
func viewHandler(w http.ResponseWriter, r *http.Request, title string) {
p, err := loadPage(title)
if err != nil {
http.Redirect(w, r, "/edit/"+title, http.StatusFound)
return
}
html := new(bytes.Buffer)
err = templates.ExecuteTemplate(html, "view.html", p)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
finalResponse := validLink.ReplaceAllString(html.String(), "<a href=\"/view/${1}\">${1}</a>")
_, err = io.WriteString(w, finalResponse)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
func editHandler(w http.ResponseWriter, r *http.Request, title string) {
p, err := loadPage(title)
if err != nil {
p = &Page{Title: title}
}
err = templates.ExecuteTemplate(w, "edit.html", p)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
func saveHandler(w http.ResponseWriter, r *http.Request, title string) {
body := r.FormValue("body")
p := &Page{Title: title, Body: []byte(body)}
err := p.save()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
http.Redirect(w, r, "/view/"+title, http.StatusFound)
}
// Page :
type Page struct {
Title string
Body []byte
}
func (p *Page) save() error {
filename := filepath.Join(dataPath, p.Title+".txt")
return ioutil.WriteFile(filename, p.Body, 0600)
}
// Lines :
func (p *Page) Lines() []string {
return strings.Split(string(p.Body), "\n")
}
func loadPage(title string) (*Page, error) {
filename := filepath.Join(dataPath, title+".txt")
body, err := ioutil.ReadFile(filename)
if err != nil {
return nil, err
}
return &Page{title, body}, nil
}