示例#1
0
文件: odb.go 项目: jgrocho/go-git2
func NewOdb() (*Odb, error) {
	odb := new(Odb)
	ecode := C.git_odb_new(&odb.git_odb)
	if ecode != git_SUCCESS {
		return nil, gitError()
	}
	return odb, nil
}
示例#2
0
文件: odb.go 项目: joshi4/shortbread
func NewOdb() (odb *Odb, err error) {
	odb = new(Odb)

	ret := C.git_odb_new(&odb.ptr)
	if ret < 0 {
		return nil, MakeGitError(ret)
	}

	runtime.SetFinalizer(odb, (*Odb).Free)
	return odb, nil
}