Skip to content

Commit 9f44c78

Browse files
authored
Merge pull request #1110 from Nordix/add-errorlint/furkat
Add errorlint to the golangci linters
2 parents 87cffe1 + 2e5dc06 commit 9f44c78

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ linters:
1010
enable:
1111
- deadcode
1212
- errcheck
13+
- errorlint
1314
- goconst
1415
- gocyclo
1516
- gofmt

cloud/services/managedclusters/managedclusters.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (s *Service) Reconcile(ctx context.Context, spec interface{}) error {
199199

200200
err = s.Client.CreateOrUpdate(ctx, managedClusterSpec.ResourceGroupName, managedClusterSpec.Name, properties)
201201
if err != nil {
202-
return fmt.Errorf("failed to create or update managed cluster, %#+v", err)
202+
return fmt.Errorf("failed to create or update managed cluster, %w", err)
203203
}
204204

205205
return nil

exp/controllers/azuremanagedmachinepool_reconciler.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ func (a *AgentPoolVMSSNotFoundError) Error() string {
7272

7373
// Is returns true if the target error is an `AgentPoolVMSSNotFoundError`.
7474
func (a *AgentPoolVMSSNotFoundError) Is(target error) bool {
75-
_, ok := target.(*AgentPoolVMSSNotFoundError)
75+
var err *AgentPoolVMSSNotFoundError
76+
ok := errors.As(target, &err)
7677
return ok
7778
}
7879

0 commit comments

Comments
 (0)