Example #1
0
File: object.go Project: tmc/goit
func (o Oid) String() string {
	if o.oid == nil {
		return "(invalid)"
	}
	ptr := C.git_oid_allocfmt(o.oid)
	defer C.free(unsafe.Pointer(ptr))
	return C.GoString(ptr)
}
Example #2
0
File: git.go Project: fsouza/gogit
func oidToString(oid *C.git_oid) string {
	id := C.git_oid_allocfmt(oid)
	defer C.free(unsafe.Pointer(id))
	return C.GoString(id)
}
Example #3
0
func (v *Oid) String() string {
	p := C.git_oid_allocfmt(v.git_oid)
	sha1 := C.GoString(p)
	C.free(unsafe.Pointer(p))
	return sha1
}