Update godeps
This commit is contained in:
parent
423433bc5f
commit
701c5a0e30
482 changed files with 86915 additions and 19741 deletions
19
vendor/k8s.io/kubernetes/pkg/api/unversioned/time_proto.go
generated
vendored
19
vendor/k8s.io/kubernetes/pkg/api/unversioned/time_proto.go
generated
vendored
|
|
@ -47,24 +47,39 @@ func (m *Time) ProtoTime() *Timestamp {
|
|||
}
|
||||
|
||||
// Size implements the protobuf marshalling interface.
|
||||
func (m *Time) Size() (n int) { return m.ProtoTime().Size() }
|
||||
func (m *Time) Size() (n int) {
|
||||
if m == nil || m.Time.IsZero() {
|
||||
return 0
|
||||
}
|
||||
return m.ProtoTime().Size()
|
||||
}
|
||||
|
||||
// Reset implements the protobuf marshalling interface.
|
||||
func (m *Time) Unmarshal(data []byte) error {
|
||||
if len(data) == 0 {
|
||||
m.Time = time.Time{}
|
||||
return nil
|
||||
}
|
||||
p := Timestamp{}
|
||||
if err := p.Unmarshal(data); err != nil {
|
||||
return err
|
||||
}
|
||||
m.Time = time.Unix(p.Seconds, int64(p.Nanos))
|
||||
m.Time = time.Unix(p.Seconds, int64(p.Nanos)).Local()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Marshal implements the protobuf marshalling interface.
|
||||
func (m *Time) Marshal() (data []byte, err error) {
|
||||
if m == nil || m.Time.IsZero() {
|
||||
return nil, nil
|
||||
}
|
||||
return m.ProtoTime().Marshal()
|
||||
}
|
||||
|
||||
// MarshalTo implements the protobuf marshalling interface.
|
||||
func (m *Time) MarshalTo(data []byte) (int, error) {
|
||||
if m == nil || m.Time.IsZero() {
|
||||
return 0, nil
|
||||
}
|
||||
return m.ProtoTime().MarshalTo(data)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue