func (object *OdbObject) Data() (data []byte) { var c_blob unsafe.Pointer = C.git_odb_object_data(object.ptr) var blob []byte len := int(C.git_odb_object_size(object.ptr)) sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&blob))) sliceHeader.Cap = len sliceHeader.Len = len sliceHeader.Data = uintptr(c_blob) return blob }
func (obj *OdbObject) Size() int { return int(C.git_odb_object_size(obj.git_odb_object)) }
func (object *OdbObject) Len() (len uint64) { return uint64(C.git_odb_object_size(object.ptr)) }
func (obj *OdbObject) Data() []byte { data := C.git_odb_object_data(obj.git_odb_object) length := C.git_odb_object_size(obj.git_odb_object) return C.GoBytes(data, C.int(length)) }