@@ -17,11 +17,11 @@ limitations under the License.
17
17
package apiutil
18
18
19
19
import (
20
+ "errors"
20
21
"sync"
21
22
"time"
22
23
23
24
"golang.org/x/time/rate"
24
- "golang.org/x/xerrors"
25
25
"k8s.io/apimachinery/pkg/api/meta"
26
26
"k8s.io/apimachinery/pkg/runtime/schema"
27
27
"k8s.io/client-go/discovery"
@@ -45,7 +45,7 @@ func (e ErrRateLimited) Error() string {
45
45
// time.Duration value and false are returned if err is not a ErrRateLimited.
46
46
func DelayIfRateLimited (err error ) (time.Duration , bool ) {
47
47
var rlerr ErrRateLimited
48
- if xerrors .As (err , & rlerr ) {
48
+ if errors .As (err , & rlerr ) {
49
49
return rlerr .Delay , true
50
50
}
51
51
return 0 , false
@@ -182,7 +182,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel
182
182
// NB(directxman12): `Is` and `As` have a confusing relationship --
183
183
// `Is` is like `== or does this implement .Is`, whereas `As` says
184
184
// `can I type-assert into`
185
- needsReload := xerrors .As (err , & needsReloadErr )
185
+ needsReload := errors .As (err , & needsReloadErr )
186
186
if ! needsReload {
187
187
return err
188
188
}
@@ -193,7 +193,7 @@ func (drm *dynamicRESTMapper) checkAndReload(needsReloadErr error, checkNeedsRel
193
193
194
194
// ... and double-check that we didn't reload in the meantime
195
195
err = checkNeedsReload ()
196
- needsReload = xerrors .As (err , & needsReloadErr )
196
+ needsReload = errors .As (err , & needsReloadErr )
197
197
if ! needsReload {
198
198
return err
199
199
}
0 commit comments