Skip to content

Commit 14f0e34

Browse files
committed
Update Errorf calls to be compliant with Go 1.24's vet checks.
1 parent ca12c92 commit 14f0e34

File tree

56 files changed

+59
-59
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+59
-59
lines changed

cims/get_csi_number_request_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (request GetCsiNumberRequest) RetryPolicy() *common.RetryPolicy {
8282
func (request GetCsiNumberRequest) ValidateEnumValue() (bool, error) {
8383
errMessage := []string{}
8484
if len(errMessage) > 0 {
85-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
85+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
8686
}
8787
return false, nil
8888
}

cims/get_status_request_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (request GetStatusRequest) RetryPolicy() *common.RetryPolicy {
6464
func (request GetStatusRequest) ValidateEnumValue() (bool, error) {
6565
errMessage := []string{}
6666
if len(errMessage) > 0 {
67-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
67+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
6868
}
6969
return false, nil
7070
}

cims/service_categories.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func (m ServiceCategories) ValidateEnumValue() (bool, error) {
4343
errMessage := []string{}
4444

4545
if len(errMessage) > 0 {
46-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
46+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
4747
}
4848
return false, nil
4949
}

cims/subscription_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (m SubscriptionInfo) ValidateEnumValue() (bool, error) {
4040
errMessage := []string{}
4141

4242
if len(errMessage) > 0 {
43-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
43+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
4444
}
4545
return false, nil
4646
}

common/auth/federation_client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func TestX509FederationClient_GetCachedSecurityToken(t *testing.T) {
280280
func TestX509FederationClient_RenewSecurityTokenSessionKeySupplierError(t *testing.T) {
281281
mockSessionKeySupplier := new(mockSessionKeySupplier)
282282
expectedErrorMessage := "TestSessionKeySupplierRefreshError"
283-
mockSessionKeySupplier.On("Refresh").Return(fmt.Errorf(expectedErrorMessage)).Once()
283+
mockSessionKeySupplier.On("Refresh").Return(fmt.Errorf("%s", expectedErrorMessage)).Once()
284284

285285
mockLeafCertificateRetriever := new(mockCertificateRetriever)
286286
mockIntermediateCertificateRetriever := new(mockCertificateRetriever)
@@ -309,7 +309,7 @@ func TestX509FederationClient_RenewSecurityTokenLeafCertificateRetrieverError(t
309309

310310
mockLeafCertificateRetriever := new(mockCertificateRetriever)
311311
expectedErrorMessage := "TestLeafCertificateRetrieverError"
312-
mockLeafCertificateRetriever.On("Refresh").Return(fmt.Errorf(expectedErrorMessage)).Once()
312+
mockLeafCertificateRetriever.On("Refresh").Return(fmt.Errorf("%s", expectedErrorMessage)).Once()
313313

314314
mockIntermediateCertificateRetriever := new(mockCertificateRetriever)
315315

@@ -341,7 +341,7 @@ func TestX509FederationClient_RenewSecurityTokenIntermediateCertificateRetriever
341341

342342
mockIntermediateCertificateRetriever := new(mockCertificateRetriever)
343343
expectedErrorMessage := "TestLeafCertificateRetrieverError"
344-
mockIntermediateCertificateRetriever.On("Refresh").Return(fmt.Errorf(expectedErrorMessage)).Once()
344+
mockIntermediateCertificateRetriever.On("Refresh").Return(fmt.Errorf("%s", expectedErrorMessage)).Once()
345345

346346
mockSecurityToken := new(mockSecurityToken)
347347
mockSecurityToken.On("Valid").Return(false)

common/auth/instance_principal_key_provider_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func TestInstancePrincipalKeyProvider_PrivateRSAKeyError(t *testing.T) {
272272
mockFederationClient := new(mockFederationClient)
273273
var nilPtr *rsa.PrivateKey
274274
expectedErrorMessage := "TestPrivateRSAKeyError"
275-
mockFederationClient.On("PrivateKey").Return(nilPtr, fmt.Errorf(expectedErrorMessage)).Once()
275+
mockFederationClient.On("PrivateKey").Return(nilPtr, fmt.Errorf("%s", expectedErrorMessage)).Once()
276276

277277
keyProvider := &instancePrincipalKeyProvider{FederationClient: mockFederationClient}
278278

@@ -300,7 +300,7 @@ func TestInstancePrincipalKeyProvider_KeyIDError(t *testing.T) {
300300
t.Parallel()
301301
mockFederationClient := new(mockFederationClient)
302302
expectedErrorMessage := "TestSecurityTokenError"
303-
mockFederationClient.On("SecurityToken").Return("", fmt.Errorf(expectedErrorMessage)).Once()
303+
mockFederationClient.On("SecurityToken").Return("", fmt.Errorf("%s", expectedErrorMessage)).Once()
304304

305305
keyProvider := &instancePrincipalKeyProvider{FederationClient: mockFederationClient}
306306

containerinstances/container_command_health_check.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (m ContainerCommandHealthCheck) ValidateEnumValue() (bool, error) {
113113
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ",")))
114114
}
115115
if len(errMessage) > 0 {
116-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
116+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
117117
}
118118
return false, nil
119119
}

containerinstances/create_container_command_health_check_details.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (m CreateContainerCommandHealthCheckDetails) ValidateEnumValue() (bool, err
9494
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for FailureAction: %s. Supported values are: %s.", m.FailureAction, strings.Join(GetContainerHealthCheckFailureActionEnumStringValues(), ",")))
9595
}
9696
if len(errMessage) > 0 {
97-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
97+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
9898
}
9999
return false, nil
100100
}

databasemanagement/disable_external_mysql_associated_service_details.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (m DisableExternalMysqlAssociatedServiceDetails) ValidateEnumValue() (bool,
4444
}
4545

4646
if len(errMessage) > 0 {
47-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
47+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
4848
}
4949
return false, nil
5050
}

databasemanagement/disable_external_mysql_associated_service_request_response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (request DisableExternalMysqlAssociatedServiceRequest) RetryPolicy() *commo
7878
func (request DisableExternalMysqlAssociatedServiceRequest) ValidateEnumValue() (bool, error) {
7979
errMessage := []string{}
8080
if len(errMessage) > 0 {
81-
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
81+
return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
8282
}
8383
return false, nil
8484
}

0 commit comments

Comments
 (0)