Esempio n. 1
0
File: blob.go Progetto: 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)
}
Esempio n. 2
0
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))
}