mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-27 03:51:20 -05:00
packer: remove ineffasign pointed assigns/decls
Some of the variables we create are flagged by our linters as ineffective assignments, which makes sense as those are generally fed by code below, so we don't need to use the declaration/assignation syntax (:=) but instead can fall back to using var with a type to get the zero value of the declared entity.
This commit is contained in:
parent
02ac9628cc
commit
2009079246
3 changed files with 2 additions and 3 deletions
|
|
@ -188,7 +188,7 @@ func (d *Datasource) Execute() (cty.Value, error) {
|
|||
iteration.ID)
|
||||
}
|
||||
|
||||
output := DatasourceOutput{}
|
||||
var output DatasourceOutput
|
||||
|
||||
cloudAndRegions := map[string][]string{}
|
||||
for _, build := range iteration.Builds {
|
||||
|
|
|
|||
|
|
@ -939,7 +939,6 @@ func (c *Core) renderVarsRecursively() (*interpolate.Context, error) {
|
|||
}
|
||||
}
|
||||
}
|
||||
deleteKeys = []string{}
|
||||
}
|
||||
|
||||
if !changed && shouldRetry {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, source
|
|||
defer os.Remove(lockFilename)
|
||||
|
||||
// Read the current manifest file from disk
|
||||
contents := []byte{}
|
||||
var contents []byte
|
||||
if contents, err = os.ReadFile(p.config.OutputPath); err != nil && !os.IsNotExist(err) {
|
||||
return source, true, true, fmt.Errorf("Unable to open %s for reading: %s", p.config.OutputPath, err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue