cleanup: use wrapped static errors instead of dynamic

In Go 1.13, the fmt.Errorf function supports a new %w verb.
When this verb is present, the error returned by fmt.Errorf
will have an Unwrap method returning the argument of %w,
which must be an error. In all other ways, %w is identical to %v.

Updates: #1227

Signed-off-by: Yug <yuggupta27@gmail.com>
This commit is contained in:
Yug
2020-07-13 09:26:51 +05:30
committed by mergify[bot]
parent 2bfe7670d2
commit 628ae9e982
7 changed files with 24 additions and 24 deletions

View File

@ -25,7 +25,7 @@ func expandPVCSize(c kubernetes.Interface, pvc *v1.PersistentVolumeClaim, size s
updatedPVC, err = c.CoreV1().PersistentVolumeClaims(pvc.Namespace).Get(context.TODO(), pvcName, metav1.GetOptions{})
if err != nil {
return fmt.Errorf("error fetching pvc %q with %v", pvcName, err)
return fmt.Errorf("error fetching pvc %q with %w", pvcName, err)
}
timeout := time.Duration(t) * time.Minute