Skip to content

Commit

Permalink
added Add method
Browse files Browse the repository at this point in the history
  • Loading branch information
zoov-xavier committed Jun 20, 2024
1 parent 048dd48 commit f127659
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/protoc-gen-go/protofif/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ func (t *Timestamp) AsTime() *time.Time {
return &ts
}

func (t *Timestamp) Add(d *Duration) *Timestamp {
timestamp := NewTimestampValue(t.AsTime().Add(d.AsDurationValue()))
return &timestamp
}

func (t *Timestamp) AsTimeValue() time.Time {
if t == nil {
return time.Time{}
Expand Down

0 comments on commit f127659

Please sign in to comment.