You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
// JSON marshaling logic for the Time type so it can be used for custom
9
9
// resources, which serialize to JSON.
10
10
11
-
func (t Time) MarshalJSON() ([]byte, error) {
12
-
var seconds, nanos int64
13
-
if t.Seconds != nil {
14
-
seconds = *t.Seconds
11
+
// Copied from https://github.com/kubernetes/kubernetes/blob/d9faaca64738a50455f38dd88845e8b4b5ca37e2/staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go
12
+
13
+
// DeepCopyInto creates a deep-copy of the Time value. The underlying time.Time
14
+
// type is effectively immutable in the time API, so it is safe to
15
+
// copy-by-assign, despite the presence of (unexported) Pointer fields.
16
+
func (t *Time) DeepCopyInto(out *Time) {
17
+
*out = *t
18
+
}
19
+
20
+
// NewTime returns a wrapped instance of the provided time
21
+
func NewTime(time time.Time) Time {
22
+
return Time{time}
23
+
}
24
+
25
+
// Date returns the Time corresponding to the supplied parameters
26
+
// by wrapping time.Date.
27
+
func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time {
0 commit comments