()
| 31 | } |
| 32 | |
| 33 | func (v *Blob) Contents() []byte { |
| 34 | size := C.int(C.git_blob_rawsize(v.cast_ptr)) |
| 35 | buffer := unsafe.Pointer(C.git_blob_rawcontent(v.cast_ptr)) |
| 36 | |
| 37 | goBytes := C.GoBytes(buffer, size) |
| 38 | runtime.KeepAlive(v) |
| 39 | |
| 40 | return goBytes |
| 41 | } |
| 42 | |
| 43 | func (v *Blob) IsBinary() bool { |
| 44 | ret := C.git_blob_is_binary(v.cast_ptr) == 1 |
no outgoing calls