Skip to content

Commit f472536

Browse files
lbajolet-hashicorpJenGoldstrich
authored andcommitted
builder: fix linter issues
With the 1.60.1 update to golangci-lint and the configuration changes, some more linting errors were reported by the linter now, so we fix those that appeared.
1 parent e85eaba commit f472536

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

builder/classic/step_list_images.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (s *stepListImages) Run(ctx context.Context, state multistep.StateBag) mult
2828
imList, err := imageListClient.GetImageList(&getInput)
2929
if err != nil {
3030
// If the list didn't exist, create it.
31-
ui.Say(fmt.Sprintf(err.Error()))
31+
ui.Say(err.Error())
3232
ui.Say(fmt.Sprintf("Destination image list %s does not exist; Creating it...",
3333
config.DestImageList))
3434

builder/oci/config.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,28 +193,28 @@ func (c *Config) Prepare(raws ...interface{}) error {
193193
// key involved.
194194
var message string = " cannot be present when use_instance_principals is set to true."
195195
if c.AccessCfgFile != "" {
196-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("access_cfg_file"+message))
196+
errs = packersdk.MultiErrorAppend(errs, errors.New("access_cfg_file"+message))
197197
}
198198
if c.AccessCfgFileAccount != "" {
199-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("access_cfg_file_account"+message))
199+
errs = packersdk.MultiErrorAppend(errs, errors.New("access_cfg_file_account"+message))
200200
}
201201
if c.UserID != "" {
202-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("user_ocid"+message))
202+
errs = packersdk.MultiErrorAppend(errs, errors.New("user_ocid"+message))
203203
}
204204
if c.TenancyID != "" {
205-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("tenancy_ocid"+message))
205+
errs = packersdk.MultiErrorAppend(errs, errors.New("tenancy_ocid"+message))
206206
}
207207
if c.Region != "" {
208-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("region"+message))
208+
errs = packersdk.MultiErrorAppend(errs, errors.New("region"+message))
209209
}
210210
if c.Fingerprint != "" {
211-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("fingerprint"+message))
211+
errs = packersdk.MultiErrorAppend(errs, errors.New("fingerprint"+message))
212212
}
213213
if c.KeyFile != "" {
214-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("key_file"+message))
214+
errs = packersdk.MultiErrorAppend(errs, errors.New("key_file"+message))
215215
}
216216
if c.PassPhrase != "" {
217-
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("pass_phrase"+message))
217+
errs = packersdk.MultiErrorAppend(errs, errors.New("pass_phrase"+message))
218218
}
219219
// This check is used to facilitate testing. During testing a Mock struct
220220
// is assigned to c.configProvider otherwise testing fails because Instance

0 commit comments

Comments
 (0)