Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
5c5ce6d2
Commit
5c5ce6d2
authored
Aug 01, 2011
by
Roger Peppe
Committed by
Rob Pike
Aug 01, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exp/template: ensure that a valid Set is returned even on error.
R=r CC=golang-dev
https://golang.org/cl/4838044
parent
317911c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/pkg/exp/template/helper.go
src/pkg/exp/template/helper.go
+3
-0
No files found.
src/pkg/exp/template/helper.go
View file @
5c5ce6d2
...
...
@@ -97,6 +97,7 @@ func (s *Set) ParseFile(filenames ...string) (*Set, os.Error) {
// named files. Each file must be individually parseable.
func
ParseSetFile
(
filenames
...
string
)
(
*
Set
,
os
.
Error
)
{
s
:=
new
(
Set
)
s
.
init
()
for
_
,
filename
:=
range
filenames
{
b
,
err
:=
ioutil
.
ReadFile
(
filename
)
if
err
!=
nil
{
...
...
@@ -193,6 +194,7 @@ func (s *Set) ParseTemplateFiles(pattern string) (*Set, os.Error) {
// encountered.
func
ParseTemplateFile
(
filenames
...
string
)
(
*
Set
,
os
.
Error
)
{
set
:=
new
(
Set
)
set
.
init
()
for
_
,
filename
:=
range
filenames
{
t
,
err
:=
ParseFile
(
filename
)
if
err
!=
nil
{
...
...
@@ -217,6 +219,7 @@ func ParseTemplateFile(filenames ...string) (*Set, os.Error) {
// encountered.
func
ParseTemplateFiles
(
pattern
string
)
(
*
Set
,
os
.
Error
)
{
set
:=
new
(
Set
)
set
.
init
()
filenames
,
err
:=
filepath
.
Glob
(
pattern
)
if
err
!=
nil
{
return
set
,
err
...
...
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