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. --- object.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'object.go') diff --git a/object.go b/object.go index f4f1b3e..5505e35 100644 --- a/object.go +++ b/object.go @@ -26,6 +26,11 @@ type Object struct { repo *Repository } +// Objecter lets us accept any kind of Git object in functions. +type Objecter interface { + AsObject() *Object +} + func (t ObjectType) String() string { switch t { case ObjectAny: -- cgit v1.2.3