Skip to content

Commit

Permalink
re-enable nilerr
Browse files Browse the repository at this point in the history
  • Loading branch information
katbyte committed Nov 14, 2024
1 parent c96cfc4 commit 19db939
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ linters:
#- nakedret # Checks that functions with naked returns are not longer than a maximum size

#### DISABLED as it doesn't appear to respect the no-lint directive
#- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.

#### bunch of hits, need to confirm if errors or not #####
#- copyloopvar #Detects range loop variables that are overwritten in the loop body
Expand Down
2 changes: 1 addition & 1 deletion internal/services/apimanagement/migration/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (ApiManagementPolicyV0ToV1) UpgradeFunc() pluginsdk.StateUpgraderFunc {
return func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
apiMgmtId, err := policy.ParseServiceID(rawState["id"].(string))
if err != nil {
return rawState, nil //nolint:nilerr // this is not an error as we just want to skip the upgrade
return rawState, nil // lint:ignore nilerr this is not an error as we just want to skip the upgrade
}
id := policy.NewServiceID(apiMgmtId.SubscriptionId, apiMgmtId.ResourceGroupName, apiMgmtId.ServiceName)
rawState["id"] = id.ID()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func resourceCapacityReservationGroupDelete(d *pluginsdk.ResourceData, meta inte
Refresh: func() (interface{}, string, error) {
res, err := client.Delete(ctx, *id)
if err != nil {
return res, "Deleting", nil //nolint:nilerr Returning nil error is intentional as we will retry the delete operation
return res, "Deleting", nil // lint:ignore nilerr Returning nil error is intentional as we will retry the delete operation
}
return res, "Deleted", nil
},
Expand Down
2 changes: 1 addition & 1 deletion internal/services/compute/no_downtime_resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func determineIfVirtualMachineSkuSupportsNoDowntimeResize(ctx context.Context, v
virtualMachineId, err := virtualmachines.ParseVirtualMachineIDInsensitively(*virtualMachineIdRaw)
if err != nil {
log.Printf("[DEBUG] unable to parse Virtual Machine ID %q that the Managed Disk is attached too - skipping no-downtime-resize since we can't guarantee that's available", *virtualMachineIdRaw)
return pointer.To(false), nil // nolint: nilerr this is not an error as we just want to skip the check in this situation since we can't guarantee it's available
return pointer.To(false), nil // lint:ignore nilerr this is not an error as we just want to skip the check in this situation since we can't guarantee it's available
}

log.Printf("[DEBUG] Retrieving %s..", *virtualMachineId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func (a AccountStaticWebsiteResource) Delete() sdk.ResourceFunc {

accountDetails, err := storageClient.FindAccount(ctx, id.SubscriptionId, id.StorageAccountName)
if err != nil {
return nil // nolint: nilerr If we don't find the account we can safely assume we don't need to remove the website since it must already be deleted
return nil // lint:ignore nilerr If we don't find the account we can safely assume we don't need to remove the website since it must already be deleted
}

properties := accounts.StorageServiceProperties{
Expand Down

0 comments on commit 19db939

Please sign in to comment.