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
67eaa07c
Commit
67eaa07c
authored
Jun 15, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: Get rid of "name" in template, wasn't used for anything
parent
d8cdc88c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
5 deletions
+0
-5
packer/template.go
packer/template.go
+0
-3
packer/template_test.go
packer/template_test.go
+0
-2
No files found.
packer/template.go
View file @
67eaa07c
...
@@ -11,7 +11,6 @@ import (
...
@@ -11,7 +11,6 @@ import (
// "interface{}" pointers since we actually don't know what their contents
// "interface{}" pointers since we actually don't know what their contents
// are until we read the "type" field.
// are until we read the "type" field.
type
rawTemplate
struct
{
type
rawTemplate
struct
{
Name
string
Builders
[]
map
[
string
]
interface
{}
Builders
[]
map
[
string
]
interface
{}
Hooks
map
[
string
][]
string
Hooks
map
[
string
][]
string
Provisioners
[]
map
[
string
]
interface
{}
Provisioners
[]
map
[
string
]
interface
{}
...
@@ -21,7 +20,6 @@ type rawTemplate struct {
...
@@ -21,7 +20,6 @@ type rawTemplate struct {
// The Template struct represents a parsed template, parsed into the most
// The Template struct represents a parsed template, parsed into the most
// completed form it can be without additional processing by the caller.
// completed form it can be without additional processing by the caller.
type
Template
struct
{
type
Template
struct
{
Name
string
Builders
map
[
string
]
rawBuilderConfig
Builders
map
[
string
]
rawBuilderConfig
Hooks
map
[
string
][]
string
Hooks
map
[
string
][]
string
Provisioners
[]
rawProvisionerConfig
Provisioners
[]
rawProvisionerConfig
...
@@ -61,7 +59,6 @@ func ParseTemplate(data []byte) (t *Template, err error) {
...
@@ -61,7 +59,6 @@ func ParseTemplate(data []byte) (t *Template, err error) {
}
}
t
=
&
Template
{}
t
=
&
Template
{}
t
.
Name
=
rawTpl
.
Name
t
.
Builders
=
make
(
map
[
string
]
rawBuilderConfig
)
t
.
Builders
=
make
(
map
[
string
]
rawBuilderConfig
)
t
.
Hooks
=
rawTpl
.
Hooks
t
.
Hooks
=
rawTpl
.
Hooks
t
.
Provisioners
=
make
([]
rawProvisionerConfig
,
len
(
rawTpl
.
Provisioners
))
t
.
Provisioners
=
make
([]
rawProvisionerConfig
,
len
(
rawTpl
.
Provisioners
))
...
...
packer/template_test.go
View file @
67eaa07c
...
@@ -11,7 +11,6 @@ func TestParseTemplate_Basic(t *testing.T) {
...
@@ -11,7 +11,6 @@ func TestParseTemplate_Basic(t *testing.T) {
data
:=
`
data
:=
`
{
{
"name": "my-image",
"builders": []
"builders": []
}
}
`
`
...
@@ -19,7 +18,6 @@ func TestParseTemplate_Basic(t *testing.T) {
...
@@ -19,7 +18,6 @@ func TestParseTemplate_Basic(t *testing.T) {
result
,
err
:=
ParseTemplate
([]
byte
(
data
))
result
,
err
:=
ParseTemplate
([]
byte
(
data
))
assert
.
Nil
(
err
,
"should not error"
)
assert
.
Nil
(
err
,
"should not error"
)
assert
.
NotNil
(
result
,
"template should not be nil"
)
assert
.
NotNil
(
result
,
"template should not be nil"
)
assert
.
Equal
(
result
.
Name
,
"my-image"
,
"name should be correct"
)
assert
.
Length
(
result
.
Builders
,
0
,
"no builders"
)
assert
.
Length
(
result
.
Builders
,
0
,
"no builders"
)
}
}
...
...
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