0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00

chore: fix linter error (#645)

Signed-off-by: Pavel Boldyrev <627562+bpg@users.noreply.github.com>
This commit is contained in:
Pavel Boldyrev 2023-10-23 18:41:26 -04:00 committed by GitHub
parent 72951dc656
commit 1056180ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 18 additions and 27 deletions

View File

@ -93,7 +93,7 @@ func (d *haGroupDatasource) Configure(
if !ok {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
fmt.Sprintf("Expected *proxmox.Client, got: %T",
req.ProviderData),
)

View File

@ -81,7 +81,7 @@ func (d *haGroupsDatasource) Configure(
if !ok {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
fmt.Sprintf("Expected *proxmox.Client, got: %T",
req.ProviderData),
)

View File

@ -104,7 +104,7 @@ func (d *haResourceDatasource) Configure(
} else {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
fmt.Sprintf("Expected *proxmox.Client, got: %T",
req.ProviderData),
)
}
@ -124,8 +124,7 @@ func (d *haResourceDatasource) Read(ctx context.Context, req datasource.ReadRequ
if err != nil {
resp.Diagnostics.AddError(
"Unexpected error parsing Proxmox HA resource identifier",
fmt.Sprintf("Couldn't parse configuration into a valid HA resource identifier: %s. "+
"Please report this issue to the provider developers.", err.Error()),
fmt.Sprintf("Couldn't parse configuration into a valid HA resource identifier: %ss", err.Error()),
)
return

View File

@ -98,7 +98,7 @@ func (d *haResourcesDatasource) Configure(
} else {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
fmt.Sprintf("Expected *proxmox.Client, got: %T",
req.ProviderData),
)
}

View File

@ -90,7 +90,7 @@ func (d *versionDatasource) Configure(
if !ok {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
fmt.Sprintf("Expected *proxmox.Client, got: %T",
req.ProviderData),
)

View File

@ -136,7 +136,7 @@ func (r *hagroupResource) Configure(
} else {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
fmt.Sprintf("Expected *proxmox.Client, got: %T",
req.ProviderData),
)
}

View File

@ -151,8 +151,7 @@ func (r *haResourceResource) Configure(
} else {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
req.ProviderData),
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
)
}
}
@ -171,8 +170,7 @@ func (r *haResourceResource) Create(ctx context.Context, req resource.CreateRequ
if err != nil {
resp.Diagnostics.AddError(
"Unexpected error parsing Proxmox HA resource identifier",
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
"Please report this issue to the provider developers.", err),
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
)
return
@ -214,8 +212,7 @@ func (r *haResourceResource) Update(
if err != nil {
resp.Diagnostics.AddError(
"Unexpected error parsing Proxmox HA resource identifier",
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
"Please report this issue to the provider developers.", err),
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
)
return
@ -253,8 +250,7 @@ func (r *haResourceResource) Delete(
if err != nil {
resp.Diagnostics.AddError(
"Unexpected error parsing Proxmox HA resource identifier",
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
"Please report this issue to the provider developers.", err),
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
)
return
@ -329,8 +325,7 @@ func (r *haResourceResource) read(ctx context.Context, data *haResourceModel) (b
if err != nil {
diags.AddError(
"Unexpected error parsing Proxmox HA resource identifier",
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s. "+
"Please report this issue to the provider developers.", err),
fmt.Sprintf("Couldn't parse the Terraform resource ID into a valid HA resource identifier: %s", err),
)
return false, diags

View File

@ -254,8 +254,7 @@ func (r *linuxBridgeResource) Configure(
if !ok {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
req.ProviderData),
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
)
return

View File

@ -228,8 +228,7 @@ func (r *linuxVLANResource) Configure(
if !ok {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
req.ProviderData),
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
)
return

View File

@ -464,8 +464,7 @@ func (r *clusterOptionsResource) Configure(
if !ok {
resp.Diagnostics.AddError(
"Unexpected Resource Configure Type",
fmt.Sprintf("Expected *proxmox.Client, got: %T. Please report this issue to the provider developers.",
req.ProviderData),
fmt.Sprintf("Expected *proxmox.Client, got: %T", req.ProviderData),
)
return

View File

@ -44,7 +44,7 @@ func AssertListMaxItems(t *testing.T, s *schema.Resource, key string, expectedMa
t.Helper()
require.NotNil(t, s.Schema[key], "Error in Schema: Missing definition for \"%s\"", key)
assert.Equal(t, s.Schema[key].MaxItems, expectedMaxItems,
assert.Equal(t, expectedMaxItems, s.Schema[key].MaxItems,
"Error in Schema: Argument \"%s\" has \"MaxItems: %#v\", but value %#v is expected!",
key, s.Schema[key].MaxItems, expectedMaxItems)
}

View File

@ -25,10 +25,10 @@ func TestCloseOrLogError(t *testing.T) {
func() {
defer f(c)
defer f(b)
assert.Equal(t, false, c.isClosed)
assert.False(t, c.isClosed)
}()
assert.Equal(t, true, c.isClosed)
assert.True(t, c.isClosed)
}
type testCloser struct {