hcl2template/types: add spaces in error messages. (#8881)

This commit is contained in:
zac 2020-03-12 23:40:25 +11:00 committed by GitHub
parent fa4b9ae958
commit 79f1fab836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,7 +308,7 @@ func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.F
"values to variables that have already been declared "+ "values to variables that have already been declared "+
"in .pkr files, not to declare new variables. To "+ "in .pkr files, not to declare new variables. To "+
"declare variable %q, place this block in one of your"+ "declare variable %q, place this block in one of your"+
" .pkr files,such as variables.pkr.hcl\n\nTo set a "+ " .pkr files, such as variables.pkr.hcl\n\nTo set a "+
"value for this variable in %s, use the definition "+ "value for this variable in %s, use the definition "+
"syntax instead:\n %s = <value>", "syntax instead:\n %s = <value>",
name, block.TypeRange.Filename, name), name, block.TypeRange.Filename, name),
@ -338,7 +338,7 @@ func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.F
Summary: "Undefined variable", Summary: "Undefined variable",
Detail: fmt.Sprintf("A %q variable was set but was "+ Detail: fmt.Sprintf("A %q variable was set but was "+
"not found in known variables. To declare "+ "not found in known variables. To declare "+
"variable %q, place this block in one of your"+ "variable %q, place this block in one of your "+
".pkr files, such as variables.pkr.hcl", ".pkr files, such as variables.pkr.hcl",
name, name), name, name),
Context: attr.Range.Ptr(), Context: attr.Range.Ptr(),
@ -375,9 +375,9 @@ func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.F
Severity: hcl.DiagError, Severity: hcl.DiagError,
Summary: "Undefined -var variable", Summary: "Undefined -var variable",
Detail: fmt.Sprintf("A %q variable was passed in the command "+ Detail: fmt.Sprintf("A %q variable was passed in the command "+
"line but was not found in known variables."+ "line but was not found in known variables. "+
"To declare variable %q, place this block in one of your"+ "To declare variable %q, place this block in one of your"+
" .pkr files,such as variables.pkr.hcl", " .pkr files, such as variables.pkr.hcl",
name, name), name, name),
}) })
continue continue