mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user