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
931f3eb7
Commit
931f3eb7
authored
May 27, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
helper/config: support outputting metadata
parent
faf327ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
helper/config/decode.go
helper/config/decode.go
+8
-0
No files found.
helper/config/decode.go
View file @
931f3eb7
...
...
@@ -13,6 +13,9 @@ import (
// DecodeOpts are the options for decoding configuration.
type
DecodeOpts
struct
{
// Metadata, if non-nil, will be set to the metadata post-decode
Metadata
*
mapstructure
.
Metadata
// Interpolate, if true, will automatically interpolate the
// configuration with the given InterpolateContext. User variables
// will be automatically detected and added in-place to the given
...
...
@@ -74,6 +77,11 @@ func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error {
}
}
// Set the metadata if it is set
if
config
.
Metadata
!=
nil
{
*
config
.
Metadata
=
md
}
// If we have unused keys, it is an error
if
len
(
md
.
Unused
)
>
0
{
var
err
error
...
...
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