Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
e851ac5d
Commit
e851ac5d
authored
Jun 18, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: Avoid an extra allocation by using clever addressing
parent
7a07802e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
packer/template.go
packer/template.go
+2
-4
No files found.
packer/template.go
View file @
e851ac5d
...
...
@@ -126,8 +126,8 @@ func ParseTemplate(data []byte) (t *Template, err error) {
t
.
PostProcessors
[
i
]
=
make
([]
rawPostProcessorConfig
,
len
(
rawPP
))
configs
:=
t
.
PostProcessors
[
i
]
for
j
,
pp
:=
range
rawPP
{
var
config
rawPostProcessorConfig
if
err
:=
mapstructure
.
Decode
(
pp
,
&
config
);
err
!=
nil
{
config
:=
&
configs
[
j
]
if
err
:=
mapstructure
.
Decode
(
pp
,
config
);
err
!=
nil
{
if
merr
,
ok
:=
err
.
(
*
mapstructure
.
Error
);
ok
{
for
_
,
err
:=
range
merr
.
Errors
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"Post-processor #%d.%d: %s"
,
i
+
1
,
j
+
1
,
err
))
...
...
@@ -145,8 +145,6 @@ func ParseTemplate(data []byte) (t *Template, err error) {
}
config
.
rawConfig
=
pp
configs
[
j
]
=
config
}
}
...
...
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