0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-07-08 14:55:02 +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 { if !ok {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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), req.ProviderData),
) )

View File

@ -81,7 +81,7 @@ func (d *haGroupsDatasource) Configure(
if !ok { if !ok {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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), req.ProviderData),
) )

View File

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

View File

@ -98,7 +98,7 @@ func (d *haResourcesDatasource) Configure(
} else { } else {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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), req.ProviderData),
) )
} }

View File

@ -90,7 +90,7 @@ func (d *versionDatasource) Configure(
if !ok { if !ok {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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), req.ProviderData),
) )

View File

@ -136,7 +136,7 @@ func (r *hagroupResource) Configure(
} else { } else {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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), req.ProviderData),
) )
} }

View File

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

View File

@ -254,8 +254,7 @@ func (r *linuxBridgeResource) Configure(
if !ok { if !ok {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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),
req.ProviderData),
) )
return return

View File

@ -228,8 +228,7 @@ func (r *linuxVLANResource) Configure(
if !ok { if !ok {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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),
req.ProviderData),
) )
return return

View File

@ -464,8 +464,7 @@ func (r *clusterOptionsResource) Configure(
if !ok { if !ok {
resp.Diagnostics.AddError( resp.Diagnostics.AddError(
"Unexpected Resource Configure Type", "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),
req.ProviderData),
) )
return return

View File

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

View File

@ -25,10 +25,10 @@ func TestCloseOrLogError(t *testing.T) {
func() { func() {
defer f(c) defer f(c)
defer f(b) 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 { type testCloser struct {