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. --- blob.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'blob.go') diff --git a/blob.go b/blob.go index 5235597..227e014 100644 --- a/blob.go +++ b/blob.go @@ -20,6 +20,10 @@ type Blob struct { cast_ptr *C.git_blob } +func (b *Blob) AsObject() *Object { + return &b.Object +} + func (v *Blob) Size() int64 { ret := int64(C.git_blob_rawsize(v.cast_ptr)) runtime.KeepAlive(v) -- cgit v1.2.3