-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbase.go
61 lines (50 loc) · 1.03 KB
/
base.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Package ftmpl is generated with ftmpl {{{v0.3.1}}}, do not edit!!!! */
package ftmpl
import (
"bytes"
"errors"
"fmt"
"github.com/SlinSo/goTemplateBenchmark/model"
"html"
"os"
)
func init() {
_ = fmt.Sprintf
_ = errors.New
_ = os.Stderr
_ = html.EscapeString
}
// TMPLERRbase evaluates a template base.tmpl
func TMPLERRbase(u *model.User, nav []*model.Navigation, title string) (string, error) {
_template := "base.tmpl"
_escape := html.EscapeString
var _ftmpl bytes.Buffer
_w := func(str string) { _, _ = _ftmpl.WriteString(str) }
_, _, _ = _template, _escape, _w
_w(`<!DOCTYPE html>
<html>
<body>
<header>
`)
_w(`</header>
<nav>
`)
_w(`</nav>
<section>
`)
_w(`</section>
<footer>
`)
_w(`</footer>
</body>
</html>`)
return _ftmpl.String(), nil
}
// TMPLbase evaluates a template base.tmpl
func TMPLbase(u *model.User, nav []*model.Navigation, title string) string {
html, err := TMPLERRbase(u, nav, title)
if err != nil {
_, _ = os.Stderr.WriteString("Error running template base.tmpl:" + err.Error())
}
return html
}