// GetBool is used to get boolean config values. // // The dot notation is used for configuration parameters. Example: // // v, err := config.GetBool("core.ignorecase") // // check errors and use v func (c *Config) GetBool(name string) (bool, error) { var v C.int cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) if C.git_config_get_bool(&v, c.config, cname) != C.GIT_OK { return false, lastErr() } return v == 1, nil }
func (cfg *Config) GetBool(name string) (bool, error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) var cval C.int ecode := C.git_config_get_bool(&cval, cfg.git_config, cname) if ecode != git_SUCCESS { return false, gitError() } return (cval != c_FALSE), nil }
func (c *Config) LookupBool(name string) (bool, error) { var out C.int cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_get_bool(&out, c.ptr, cname) if ret < 0 { return false, MakeGitError(ret) } return out != 0, nil }