Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
36283ae0
authored
2013-03-01 14:50:06 +0800
by
Jason Lee
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix a wrong logical for AddFuncMap method.
1 parent
53f917c9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
template.go
template.go
View file @
36283ae
...
...
@@ -3,9 +3,8 @@ package beego
//@todo add template funcs
import
(
//"fmt"
"errors"
"fmt"
"errors"
"github.com/russross/blackfriday"
"html/template"
"strings"
...
...
@@ -88,8 +87,8 @@ func Compare(a, b interface{}) (equal bool) {
// AddFuncMap let user to register a func in the template
func
AddFuncMap
(
key
string
,
funname
interface
{})
error
{
if
_
,
ok
:=
beegoTplFuncMap
[
key
];
ok
{
return
errors
.
New
(
"funcmap already has the key"
)
}
beegoTplFuncMap
[
key
]
=
funname
return
nil
}
return
errors
.
New
(
"funcmap already has the key"
)
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment