diff options
| author | Vicent Marti <[email protected]> | 2013-04-16 23:04:35 +0200 |
|---|---|---|
| committer | Vicent Marti <[email protected]> | 2013-04-16 23:04:35 +0200 |
| commit | d190d8a6b3717402744902d060be57195f27d604 (patch) | |
| tree | bbaa99449afa98545eb7833831d085e5875377dd /blob.go | |
| parent | c7286515b83bae368245b5cf2dc92971e16b21ff (diff) | |
Take 2 on polymorphism
Diffstat (limited to 'blob.go')
| -rw-r--r-- | blob.go | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -7,17 +7,25 @@ package git */ import "C" import ( - "runtime" "unsafe" + "runtime" ) type Blob struct { - ptr *C.git_object + ptr *C.git_blob +} + +func (o *Blob) Id() *Oid { + return newOidFromC(C.git_blob_id(o.ptr)) +} + +func (o *Blob) Type() ObjectType { + return OBJ_BLOB } -func (v *Blob) Free() { - runtime.SetFinalizer(v, nil) - C.git_object_free(v.ptr) +func (o *Blob) Free() { + runtime.SetFinalizer(o, nil) + C.git_blob_free(o.ptr) } func (v *Blob) Size() int64 { |
