1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Switch to Go 1.13 error wrapping (#604)

* Replaced errors.Wrap with fmt.Errorf (#589)

* Find:    errors\.Wrap\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)

* Replaced errors.Wrapf with fmt.Errorf (#589)

* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])\)
  Replace: fmt.Errorf($2: %w$3, $1)
* Find:    errors\.Wrapf\(([^,]+),\s+(["`][^"`]*)(["`])(,[^)]+)\)
* Replace: fmt.Errorf($2: %w$3$4, $1)

* Replaced errors.Errorf with fmt.Errorf (#589)

* Find:    errors\.Errorf
  Replace: fmt.Errorf

* Cleaned up remaining imports

* Cleanup

* Regenerate provider support matrix

This was broken by #533 ... and it's now the third time this has been missed.
This commit is contained in:
Patrick Gaskin
2020-01-28 11:06:56 -05:00
committed by Tom Limoncelli
parent cae35a2c8f
commit 825ba2d081
64 changed files with 328 additions and 379 deletions

View File

@@ -11,8 +11,6 @@ import (
"strings"
"github.com/google/go-github/github"
"github.com/pkg/errors"
"golang.org/x/oauth2"
)
@@ -60,7 +58,7 @@ func checkGoFmt() error {
if fList == "" {
return nil
}
return errors.Errorf("The following files need to have gofmt run on them:\n%s", fList)
return fmt.Errorf("The following files need to have gofmt run on them:\n%s", fList)
}
func checkGoGenerate() error {
@@ -76,7 +74,7 @@ func checkGoGenerate() error {
return err
}
if len(modified) != 0 {
return errors.Errorf("ERROR: The following files are modified after go generate:\n%s", strings.Join(modified, "\n"))
return fmt.Errorf("ERROR: The following files are modified after go generate:\n%s", strings.Join(modified, "\n"))
}
return nil
}