From f127659afc61a3d220e81ef382603c59b62b1a34 Mon Sep 17 00:00:00 2001 From: zoov-xavier Date: Thu, 20 Jun 2024 14:42:46 +0200 Subject: [PATCH] added Add method --- cmd/protoc-gen-go/protofif/methods.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/protoc-gen-go/protofif/methods.go b/cmd/protoc-gen-go/protofif/methods.go index 9372223b3..60f8ff28f 100644 --- a/cmd/protoc-gen-go/protofif/methods.go +++ b/cmd/protoc-gen-go/protofif/methods.go @@ -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 ×tamp +} + func (t *Timestamp) AsTimeValue() time.Time { if t == nil { return time.Time{}