Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
helm3
Commits
124235ff
Commit
124235ff
authored
Apr 29, 2017
by
Fabian Ruff
Committed by
GitHub
Apr 29, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail template execution if included template fails
parent
3a943696
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
engine.go
pkg/engine/engine.go
+3
-3
No files found.
pkg/engine/engine.go
View file @
124235ff
...
@@ -138,12 +138,12 @@ func (e *Engine) alterFuncMap(t *template.Template) template.FuncMap {
...
@@ -138,12 +138,12 @@ func (e *Engine) alterFuncMap(t *template.Template) template.FuncMap {
}
}
// Add the 'include' function here so we can close over t.
// Add the 'include' function here so we can close over t.
funcMap
[
"include"
]
=
func
(
name
string
,
data
interface
{})
string
{
funcMap
[
"include"
]
=
func
(
name
string
,
data
interface
{})
(
string
,
error
)
{
buf
:=
bytes
.
NewBuffer
(
nil
)
buf
:=
bytes
.
NewBuffer
(
nil
)
if
err
:=
t
.
ExecuteTemplate
(
buf
,
name
,
data
);
err
!=
nil
{
if
err
:=
t
.
ExecuteTemplate
(
buf
,
name
,
data
);
err
!=
nil
{
buf
.
WriteString
(
err
.
Error
())
return
""
,
err
}
}
return
buf
.
String
()
return
buf
.
String
()
,
nil
}
}
// Add the 'required' function here
// Add the 'required' function here
...
...
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