summaryrefslogtreecommitdiff
path: root/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-06-24 21:29:31 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-06-24 21:29:31 +0200
commit2388222e98462fdbbe44f3e091b2b79d80956a9a (patch)
tree17078d861c20a3e48b19c750c6864c5f59248386 /vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
parenta1a4a75abee2c381483a218e1660621ee416ef7c (diff)
downloadpodman-2388222e98462fdbbe44f3e091b2b79d80956a9a.tar.gz
podman-2388222e98462fdbbe44f3e091b2b79d80956a9a.tar.bz2
podman-2388222e98462fdbbe44f3e091b2b79d80956a9a.zip
update dependencies
Ran a `go get -u` and bumped K8s deps to 1.15.0. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go')
-rw-r--r--vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go36
1 files changed, 26 insertions, 10 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
index 7e5bc2d4e..cdd9a6a7a 100644
--- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
+++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/micro_time.go
@@ -41,11 +41,6 @@ func (t *MicroTime) DeepCopyInto(out *MicroTime) {
*out = *t
}
-// String returns the representation of the time.
-func (t MicroTime) String() string {
- return t.Time.String()
-}
-
// NewMicroTime returns a wrapped instance of the provided time
func NewMicroTime(time time.Time) MicroTime {
return MicroTime{time}
@@ -72,22 +67,40 @@ func (t *MicroTime) IsZero() bool {
// Before reports whether the time instant t is before u.
func (t *MicroTime) Before(u *MicroTime) bool {
- return t.Time.Before(u.Time)
+ if t != nil && u != nil {
+ return t.Time.Before(u.Time)
+ }
+ return false
}
// Equal reports whether the time instant t is equal to u.
func (t *MicroTime) Equal(u *MicroTime) bool {
- return t.Time.Equal(u.Time)
+ if t == nil && u == nil {
+ return true
+ }
+ if t != nil && u != nil {
+ return t.Time.Equal(u.Time)
+ }
+ return false
}
// BeforeTime reports whether the time instant t is before second-lever precision u.
func (t *MicroTime) BeforeTime(u *Time) bool {
- return t.Time.Before(u.Time)
+ if t != nil && u != nil {
+ return t.Time.Before(u.Time)
+ }
+ return false
}
// EqualTime reports whether the time instant t is equal to second-lever precision u.
func (t *MicroTime) EqualTime(u *Time) bool {
- return t.Time.Equal(u.Time)
+ if t == nil && u == nil {
+ return true
+ }
+ if t != nil && u != nil {
+ return t.Time.Equal(u.Time)
+ }
+ return false
}
// UnixMicro returns the local time corresponding to the given Unix time
@@ -104,7 +117,10 @@ func (t *MicroTime) UnmarshalJSON(b []byte) error {
}
var str string
- json.Unmarshal(b, &str)
+ err := json.Unmarshal(b, &str)
+ if err != nil {
+ return err
+ }
pt, err := time.Parse(RFC3339Micro, str)
if err != nil {