Remove github.com/pkg/errors dependency (#5557)

* Change errors.Wrapf

* Replace errors.Wrap

* Dont use pkg/errors (except error.Cause)

* Fix errors on Windows (do not test system underlying message)

* Replace errors.Cause

* Review
This commit is contained in:
Philippe Martin
2022-03-21 11:32:42 +01:00
committed by GitHub
parent 1d2cf39cf7
commit 24fd02673d
74 changed files with 371 additions and 383 deletions

View File

@@ -1,10 +1,10 @@
package main
import (
"errors"
"fmt"
"os"
"github.com/pkg/errors"
"github.com/redhat-developer/odo/pkg/odo/cli"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
@@ -185,7 +185,15 @@ func main() {
err := clidoc.Execute()
if err != nil {
fmt.Println(errors.Cause(err))
for {
e := errors.Unwrap(err)
if e != nil {
err = e
} else {
break
}
}
fmt.Println(err)
os.Exit(1)
}
}