pkg: switch to golang native error wrapping

We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This commit is contained in:
Sascha Grunert
2022-07-06 09:48:36 +02:00
parent 862cc42ddc
commit a46f798831
130 changed files with 879 additions and 875 deletions

View File

@ -1,11 +1,12 @@
package libpod
import (
"errors"
"fmt"
"net/http"
"os"
"github.com/containers/podman/v4/pkg/api/handlers/utils"
"github.com/pkg/errors"
)
// DefaultPodmanSwaggerSpec provides the default path to the podman swagger spec file
@ -18,7 +19,7 @@ func ServeSwagger(w http.ResponseWriter, r *http.Request) {
}
if _, err := os.Stat(path); err != nil {
if errors.Is(err, os.ErrNotExist) {
utils.InternalServerError(w, errors.Errorf("swagger spec %q does not exist", path))
utils.InternalServerError(w, fmt.Errorf("swagger spec %q does not exist", path))
return
}
utils.InternalServerError(w, err)