From 97c56347a147f6122e158f623945385b560e1a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 4 Mar 2015 19:57:03 +0100 Subject: [PATCH] Better error reporting when a config key in template is Unknown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch will allow to fix the following bug much faster: ``` 1 error(s) occurred: * Unknown configuration key: output_directory ``` Related configuration: ``` "output_directory ": "build/sl_base/", ``` After the patch, the error reporting will be: ``` 1 error(s) occurred: * Unknown configuration key: "output_directory¤" ``` --- common/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config.go b/common/config.go index 4a56cc356..72b3bdd27 100644 --- a/common/config.go +++ b/common/config.go @@ -33,7 +33,7 @@ func CheckUnusedConfig(md *mapstructure.Metadata) *packer.MultiError { for _, unused := range md.Unused { if unused != "type" && !strings.HasPrefix(unused, "packer_") { errs = append( - errs, fmt.Errorf("Unknown configuration key: %s", unused)) + errs, fmt.Errorf("Unknown configuration key: %q", unused)) } } }