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
206f7368
Commit
206f7368
authored
Mar 14, 2017
by
astaxie
Committed by
GitHub
Mar 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2496 from eyalpost/develop
Don't panic during AddViewPath if adding the same path twice
parents
46f3ea4f
24d4a278
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 @
206f7368
...
...
@@ -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