diff options
author | Unknwon <u@gogs.io> | 2016-08-09 12:56:00 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-09 12:56:00 -0700 |
commit | f70343660dc4cb585d2d322fcfb33f73f371683e (patch) | |
tree | 658bdcc07d2f360006c9b394565ab7b139b68271 /modules | |
parent | c8b45ecc2762a9d64dbe83cafd68b137661448a5 (diff) | |
download | gitea-f70343660dc4cb585d2d322fcfb33f73f371683e.tar.gz gitea-f70343660dc4cb585d2d322fcfb33f73f371683e.zip |
Little code refactoring
Diffstat (limited to 'modules')
-rw-r--r-- | modules/template/template.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/template/template.go b/modules/template/template.go index ed5b08a2ec..76ab66bcb4 100644 --- a/modules/template/template.go +++ b/modules/template/template.go @@ -96,7 +96,6 @@ func NewFuncMap() []template.FuncMap { "ShortSha": base.ShortSha, "MD5": base.EncodeMD5, "ActionContent2Commits": ActionContent2Commits, - "ToUtf8": ToUtf8, "EscapePound": func(str string) string { return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20").Replace(str) }, @@ -115,10 +114,6 @@ func Str2html(raw string) template.HTML { return template.HTML(markdown.Sanitizer.Sanitize(raw)) } -func Range(l int) []int { - return make([]int, l) -} - func List(l *list.List) chan interface{} { e := l.Front() c := make(chan interface{}) @@ -136,7 +131,7 @@ func Sha1(str string) string { return base.EncodeSha1(str) } -func ToUtf8WithErr(content []byte) (error, string) { +func ToUTF8WithErr(content []byte) (error, string) { charsetLabel, err := base.DetectEncoding(content) if err != nil { return err, "" @@ -159,8 +154,8 @@ func ToUtf8WithErr(content []byte) (error, string) { return err, result } -func ToUtf8(content string) string { - _, res := ToUtf8WithErr([]byte(content)) +func ToUTF8(content string) string { + _, res := ToUTF8WithErr([]byte(content)) return res } |