[PATCH] go: add binding for notmuch_message_get_date
Tomi Ollila
tomi.ollila at iki.fi
Tue Mar 3 04:32:09 PST 2015
On Mon, Mar 02 2015, Trevor Jim <tjim at mac.com> wrote:
> ---
> bindings/go/src/notmuch/notmuch.go | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go
> index b9230ad..f5fd54c 100644
> --- a/bindings/go/src/notmuch/notmuch.go
> +++ b/bindings/go/src/notmuch/notmuch.go
> @@ -801,7 +801,13 @@ func (self *Message) SetFlag(flag Flag, value bool) {
> C.notmuch_message_set_flag(self.message, C.notmuch_message_flag_t(flag), v)
> }
>
> -// TODO: wrap notmuch_message_get_date
> +func (self *Message) GetDate() int64 {
> + if self.message == nil {
> + return -1
-1 is 1969-dec-31 23:59:59 UTC
Should we care -- and e.g. return status in separate return value ?
Tomi
> + }
> + timestamp := C.notmuch_message_get_date(self.message)
> + return int64(timestamp)
> +}
>
> /* Get the value of the specified header from 'message'.
> *
> --
> 2.2.2
More information about the notmuch
mailing list