From 7f685a6ee64db446a8b2d05f98796a1bf63984d9 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Sat, 8 Jul 2017 22:53:50 +0200 Subject: Add Objecer interface We do want to be able to accept generic objects in functions. Add this interface so we can accept that instead of specific object types. --- commit.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'commit.go') diff --git a/commit.go b/commit.go index 5aa5f25..223b093 100644 --- a/commit.go +++ b/commit.go @@ -18,6 +18,10 @@ type Commit struct { cast_ptr *C.git_commit } +func (c *Commit) AsObject() *Object { + return &c.Object +} + func (c *Commit) Message() string { ret := C.GoString(C.git_commit_message(c.cast_ptr)) runtime.KeepAlive(c) -- cgit v1.2.3