func (patch *Patch) String() (string, error) { if patch.ptr == nil { return "", ErrInvalid } var buf C.git_buf ecode := C.git_patch_to_buf(&buf, patch.ptr) if ecode < 0 { return "", MakeGitError(ecode) } return C.GoString(buf.ptr), nil }
func (patch *Patch) String() (string, error) { if patch.ptr == nil { return "", ErrInvalid } var buf C.git_buf runtime.LockOSThread() defer runtime.UnlockOSThread() ecode := C.git_patch_to_buf(&buf, patch.ptr) if ecode < 0 { return "", MakeGitError(ecode) } return C.GoString(buf.ptr), nil }