func (odb *Odb) Read(oid *Oid) (*OdbObject, error) { obj := new(OdbObject) ecode := C.git_odb_read(&obj.git_odb_object, odb.git_odb, oid.git_oid) if ecode != git_SUCCESS { return nil, gitError() } return obj, nil }
func (v *Odb) Read(oid *Oid) (obj *OdbObject, err error) { obj = new(OdbObject) ret := C.git_odb_read(&obj.ptr, v.ptr, oid.toC()) if ret < 0 { return nil, LastError() } runtime.SetFinalizer(obj, (*OdbObject).Free) return }
func (v *Odb) Read(oid *Oid) (obj *OdbObject, err error) { obj = new(OdbObject) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_odb_read(&obj.ptr, v.ptr, oid.toC()) if ret < 0 { return nil, MakeGitError(ret) } runtime.SetFinalizer(obj, (*OdbObject).Free) return obj, nil }