Skip to content

Commit

Permalink
Remove unnecessarry if statements for operationWaiter errors (#8860) (#…
Browse files Browse the repository at this point in the history
…15724)

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Sep 5, 2023
1 parent c3acecd commit ff4d3a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .changelog/8860.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:none
Remove unnecessary if statements for OperationWait
```
10 changes: 2 additions & 8 deletions google/tpgresource/common_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,7 @@ func CommonRefreshFunc(w Waiter) resource.StateRefreshFunc {

func OperationWait(w Waiter, activity string, timeout time.Duration, pollInterval time.Duration) error {
if OperationDone(w) {
if w.Error() != nil {
return w.Error()
}
return nil
return w.Error()
}

c := &resource.StateChangeConf{
Expand All @@ -163,11 +160,8 @@ func OperationWait(w Waiter, activity string, timeout time.Duration, pollInterva
if err != nil {
return err
}
if w.Error() != nil {
return w.Error()
}

return nil
return w.Error()
}

// The cloud resource manager API operation is an example of one of many
Expand Down

0 comments on commit ff4d3a7

Please sign in to comment.