Skip to content

Commit 61d2fce

Browse files
author
Adrien Pensart
committed
fix(linter): warnings
Signed-off-by: Adrien Pensart <[email protected]>
1 parent cba8e7c commit 61d2fce

19 files changed

+28
-33
lines changed

ovh/data_dbaas_logs_input_engine.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ func dataSourceDbaasLogsInputEngineRead(d *schema.ResourceData, meta interface{}
7878
}
7979

8080
match := true
81-
if nameFilter != nil && strings.ToLower(engine.Name) != strings.ToLower(*nameFilter) {
81+
if nameFilter != nil && !strings.EqualFold(engine.Name, *nameFilter) {
8282
match = false
8383
}
84-
if versionFilter != nil && strings.ToLower(engine.Version) != strings.ToLower(*versionFilter) {
84+
if versionFilter != nil && !strings.EqualFold(engine.Version, *versionFilter) {
8585
match = false
8686
}
8787
if isDeprecatedFilter != nil && engine.IsDeprecated != *isDeprecatedFilter {

ovh/data_dbaas_logs_output_graylog_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func dataSourceDbaasLogsOutputGraylogStreamRead(ctx context.Context, d *schema.R
183183
strings.ToLower(titleFilter),
184184
)
185185

186-
if strings.ToLower(stream.Title) == strings.ToLower(titleFilter) {
186+
if strings.EqualFold(stream.Title, titleFilter) {
187187
streams = append(streams, stream)
188188
}
189189
}

ovh/data_dbaas_logs_output_opensearch_index.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func dataSourceDbaasLogsOutputOpensearchIndexRead(ctx context.Context, d *schema
113113
strings.ToLower(nameFilter),
114114
)
115115

116-
if strings.ToLower(index.Name) == strings.ToLower(nameFilter) {
116+
if strings.EqualFold(index.Name, nameFilter) {
117117
indexes = append(indexes, index)
118118
}
119119
}

ovh/me_payment_mean.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var (
1414

1515
func MePaymentMeanBankAccounts(c *ovhwrap.Client) ([]*MePaymentMeanBankAccount, error) {
1616
ids := &[]int64{}
17-
endpoint := fmt.Sprintf("/me/paymentMean/bankAccount")
17+
endpoint := "/me/paymentMean/bankAccount"
1818
if err := c.Get(endpoint, ids); err != nil {
1919
return nil, fmt.Errorf("Error calling GET %s", endpoint)
2020
}
@@ -39,7 +39,7 @@ func MePaymentMeanBankAccounts(c *ovhwrap.Client) ([]*MePaymentMeanBankAccount,
3939

4040
func MePaymentMeanCreditCards(c *ovhwrap.Client) ([]*MePaymentMeanCreditCard, error) {
4141
ids := &[]int64{}
42-
endpoint := fmt.Sprintf("/me/paymentMean/creditCard")
42+
endpoint := "/me/paymentMean/creditCard"
4343
if err := c.Get(endpoint, ids); err != nil {
4444
return nil, fmt.Errorf("Error calling GET %s", endpoint)
4545
}
@@ -64,7 +64,7 @@ func MePaymentMeanCreditCards(c *ovhwrap.Client) ([]*MePaymentMeanCreditCard, er
6464

6565
func MePaymentMeanPaypals(c *ovhwrap.Client) ([]*MePaymentMeanPaypal, error) {
6666
ids := &[]int64{}
67-
endpoint := fmt.Sprintf("/me/paymentMean/paypal")
67+
endpoint := "/me/paymentMean/paypal"
6868
if err := c.Get(endpoint, ids); err != nil {
6969
return nil, fmt.Errorf("Error calling GET %s", endpoint)
7070
}

ovh/notification_email.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func notificationEmailSortedIds(config *Config) ([]int64, error) {
1212
log.Printf("[DEBUG] Will read notification emails ids")
1313
res := []int64{}
1414

15-
endpoint := fmt.Sprintf("/me/notification/email/history")
15+
endpoint := "/me/notification/email/history"
1616
if err := config.OVHClient.Get(endpoint, &res); err != nil {
1717
return nil, fmt.Errorf("calling Get %s:\n\t %q", endpoint, err)
1818
}

ovh/order_cart.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ func orderCartCreate(meta interface{}, params *OrderCartCreateOpts, assign bool)
530530
r := &OrderCart{}
531531

532532
log.Printf("[DEBUG] Will create order cart: %v", params)
533-
endpoint := fmt.Sprintf(
534-
"/order/cart",
535-
)
533+
endpoint := "/order/cart"
536534

537535
err := config.OVHClient.Post(endpoint, params, r)
538536
if err != nil {

ovh/resource_cloud_project_containerregistry_ip_restrictions_management.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package ovh
22

33
import (
4-
"errors"
54
"fmt"
65
"log"
76
"net"
@@ -47,7 +46,7 @@ func resourceCloudProjectContainerRegistryIPRestrictionsManagement() *schema.Res
4746
ipRestriction := ipRestrictionInterface.(map[string]interface{})
4847

4948
if ipRestriction["ip_block"] == nil {
50-
return nil, []error{errors.New(fmt.Sprintf("ipBlock attribute is mandatory for ip_restrictions: %s", path))}
49+
return nil, []error{fmt.Errorf("ipBlock attribute is mandatory for ip_restrictions: %s", path)}
5150
}
5251

5352
ipBlockString := ipRestriction["ip_block"].(string)

ovh/resource_cloud_project_containerregistry_ip_restrictions_registry.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package ovh
22

33
import (
4-
"errors"
54
"fmt"
65
"log"
76
"net"
@@ -47,7 +46,7 @@ func resourceCloudProjectContainerRegistryIPRestrictionsRegistry() *schema.Resou
4746
ipRestriction := ipRestrictionInterface.(map[string]interface{})
4847

4948
if ipRestriction["ip_block"] == nil {
50-
return nil, []error{errors.New(fmt.Sprintf("ipBlock attribute is mandatory for ip_restrictions: %s", path))}
49+
return nil, []error{fmt.Errorf("ipBlock attribute is mandatory for ip_restrictions: %s", path)}
5150
}
5251

5352
ipBlockString := ipRestriction["ip_block"].(string)

ovh/resource_cloud_project_kube_nodepool.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package ovh
22

33
import (
4-
"errors"
54
"fmt"
65
"log"
76
"strings"
@@ -227,11 +226,11 @@ func resourceCloudProjectKubeNodePool() *schema.Resource {
227226
taint := taintInterface.(map[string]interface{})
228227

229228
if taint["key"] == nil {
230-
return nil, []error{errors.New(fmt.Sprintf("key attribute is mandatory for taint: %s", path))}
229+
return nil, []error{fmt.Errorf("key attribute is mandatory for taint: %s", path)}
231230
}
232231

233232
if taint["effect"] == nil {
234-
return nil, []error{errors.New(fmt.Sprintf("effect attribute is mandatory for taint: %s", path))}
233+
return nil, []error{fmt.Errorf("effect attribute is mandatory for taint: %s", path)}
235234
}
236235

237236
effectString := taint["effect"].(string)

ovh/resource_cloud_project_volume.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (r *cloudProjectVolumeResource) Create(ctx context.Context, req resource.Cr
8181
resWait, err := r.WaitForVolumeCreation(ctx, r.config.OVHClient, data.ServiceName.ValueString(), responseData.Id.ValueString())
8282
if err != nil {
8383
resp.Diagnostics.AddError(
84-
fmt.Sprintf("Error calling Operation"),
84+
"Error calling Operation",
8585
err.Error(),
8686
)
8787
return

0 commit comments

Comments
 (0)