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

@ -2,6 +2,7 @@ package util
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"path/filepath"
@ -9,14 +10,13 @@ import (
"time"
"github.com/containers/podman/v4/pkg/timetype"
"github.com/pkg/errors"
)
// ComputeUntilTimestamp extracts until timestamp from filters
func ComputeUntilTimestamp(filterValues []string) (time.Time, error) {
invalid := time.Time{}
if len(filterValues) != 1 {
return invalid, errors.Errorf("specify exactly one timestamp for until")
return invalid, errors.New("specify exactly one timestamp for until")
}
ts, err := timetype.GetTimestamp(filterValues[0], time.Now())
if err != nil {