Пример #1
0
func FindGlobalConfig() string {
	var path [git_PATH_MAX]int8
	cpath := (*C.char)(&path[0])
	ecode := C.git_config_find_global(cpath, C.size_t(git_PATH_MAX))
	if ecode != git_SUCCESS {
		return ""
	}
	return C.GoString(cpath)
}
Пример #2
0
func ConfigFindGlobal() (string, error) {
	var buf C.git_buf
	defer C.git_buf_free(&buf)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_config_find_global(&buf)
	if ret < 0 {
		return "", MakeGitError(ret)
	}

	return C.GoString(buf.ptr), nil
}