Generate gogo stringer instead of proto stringer

Similar to %#v.
This commit is contained in:
Clayton Coleman
2016-07-11 23:19:06 -04:00
parent bea382c124
commit 8c17b48824
2 changed files with 11 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ import (
//
// +protobuf.options.marshal=false
// +protobuf.as=Timestamp
// +protobuf.options.(gogoproto.goproto_stringer)=false
type Time struct {
time.Time `protobuf:"-"`
}
@@ -40,6 +41,11 @@ func (t Time) DeepCopy() Time {
return t
}
// String returns the representation of the time.
func (t Time) String() string {
return t.Time.String()
}
// NewTime returns a wrapped instance of the provided time
func NewTime(time time.Time) Time {
return Time{time}