示例#1
0
文件: blob.go 项目: wid/git2go
func (v *Blob) Contents() []byte {
	size := C.int(C.git_blob_rawsize(v.cast_ptr))
	buffer := unsafe.Pointer(C.git_blob_rawcontent(v.cast_ptr))
	return C.GoBytes(buffer, size)
}
示例#2
0
文件: blob.go 项目: jgrocho/go-git2
func (blob *Blob) Content() []byte {
	size := C.git_blob_rawsize(blob.git_blob)
	content := C.git_blob_rawcontent(blob.git_blob)
	return C.GoBytes(unsafe.Pointer(content), C.int(size))
}