Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
24d4a278
Commit
24d4a278
authored
Mar 13, 2017
by
Eyal Post
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't panic during AddViewPath if adding the same path twice
parent
fc2c0f4f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
template.go
template.go
+4
-1
No files found.
template.go
View file @
24d4a278
...
...
@@ -72,7 +72,7 @@ func ExecuteViewPathTemplate(wr io.Writer, name string, viewPath string, data in
}
panic
(
"can't find templatefile in the path:"
+
viewPath
+
"/"
+
name
)
}
panic
(
"Uknown view path:"
+
viewPath
)
panic
(
"U
n
known view path:"
+
viewPath
)
}
func
init
()
{
...
...
@@ -165,6 +165,9 @@ func AddTemplateExt(ext string) {
//will panic if called after beego.Run()
func
AddViewPath
(
viewPath
string
)
error
{
if
beeViewPathTemplateLocked
{
if
_
,
exist
:=
beeViewPathTemplates
[
viewPath
];
exist
{
return
nil
//Ignore if viewpath already exists
}
panic
(
"Can not add new view paths after beego.Run()"
)
}
beeViewPathTemplates
[
viewPath
]
=
make
(
map
[
string
]
*
template
.
Template
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment