Skip to content

Commit 3232543

Browse files
authored
helper/resource: Add missing equals for type aliases (#1177)
Reference: hashicorp/terraform-plugin-sdk#1176
1 parent 773d73e commit 3232543

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: BUG FIXES
2+
body: 'helper/resource: Prevented build errors with type aliasing added in v2.26.0'
3+
time: 2023-03-21T08:56:55.662651-04:00
4+
custom:
5+
Issue: "1176"

helper/resource/aliases.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ func PrefixedUniqueId(prefix string) string {
4242

4343
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
4444
// testing to terraform-plugin-testing.
45-
type NotFoundError retry.NotFoundError
45+
type NotFoundError = retry.NotFoundError
4646

4747
// UnexpectedStateError is returned when Refresh returns a state that's neither in Target nor Pending
4848
//
4949
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
5050
// testing to terraform-plugin-testing.
51-
type UnexpectedStateError retry.UnexpectedStateError
51+
type UnexpectedStateError = retry.UnexpectedStateError
5252

5353
// TimeoutError is returned when WaitForState times out
5454
//
5555
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
5656
// testing to terraform-plugin-testing.
57-
type TimeoutError retry.TimeoutError
57+
type TimeoutError = retry.TimeoutError
5858

5959
// StateRefreshFunc is a function type used for StateChangeConf that is
6060
// responsible for refreshing the item being watched for a state change.
@@ -69,19 +69,19 @@ type TimeoutError retry.TimeoutError
6969
//
7070
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
7171
// testing to terraform-plugin-testing.
72-
type StateRefreshFunc retry.StateRefreshFunc
72+
type StateRefreshFunc = retry.StateRefreshFunc
7373

7474
// StateChangeConf is the configuration struct used for `WaitForState`.
7575
//
7676
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
7777
// testing to terraform-plugin-testing.
78-
type StateChangeConf retry.StateChangeConf
78+
type StateChangeConf = retry.StateChangeConf
7979

8080
// RetryFunc is the function retried until it succeeds.
8181
//
8282
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
8383
// testing to terraform-plugin-testing.
84-
type RetryFunc retry.RetryFunc
84+
type RetryFunc = retry.RetryFunc
8585

8686
// RetryContext is a basic wrapper around StateChangeConf that will just retry
8787
// a function until it no longer returns an error.
@@ -92,7 +92,7 @@ type RetryFunc retry.RetryFunc
9292
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
9393
// testing to terraform-plugin-testing.
9494
func RetryContext(ctx context.Context, timeout time.Duration, f RetryFunc) error {
95-
return retry.RetryContext(ctx, timeout, retry.RetryFunc(f))
95+
return retry.RetryContext(ctx, timeout, f)
9696
}
9797

9898
// Retry is a basic wrapper around StateChangeConf that will just retry
@@ -101,15 +101,15 @@ func RetryContext(ctx context.Context, timeout time.Duration, f RetryFunc) error
101101
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
102102
// testing to terraform-plugin-testing.
103103
func Retry(timeout time.Duration, f RetryFunc) error {
104-
return retry.Retry(timeout, retry.RetryFunc(f))
104+
return retry.Retry(timeout, f)
105105
}
106106

107107
// RetryError is the required return type of RetryFunc. It forces client code
108108
// to choose whether or not a given error is retryable.
109109
//
110110
// Deprecated: Use helper/retry package instead. This is required for migrating acceptance
111111
// testing to terraform-plugin-testing.
112-
type RetryError retry.RetryError
112+
type RetryError = retry.RetryError
113113

114114
// RetryableError is a helper to create a RetryError that's retryable from a
115115
// given error. To prevent logic errors, will return an error when passed a

0 commit comments

Comments
 (0)