// SetString is used to add a string setting to the config file. // // The format of the configuration parameter is the same as in GetBool. If the // parameter is not declared in the config file, it will be created. func (c *Config) SetString(name, value string) error { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) cvalue := C.CString(value) defer C.free(unsafe.Pointer(cvalue)) if C.git_config_set_string(c.config, cname, cvalue) != C.GIT_OK { return lastErr() } return nil }
func (cfg *Config) SetString(name, value string) error { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) cvalue := C.CString(value) defer C.free(unsafe.Pointer(cvalue)) ecode := C.git_config_set_string(cfg.git_config, cname, cvalue) if ecode != git_SUCCESS { return gitError() } return nil }
func (c *Config) Set(name, value string) (err error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) cvalue := C.CString(value) defer C.free(unsafe.Pointer(cvalue)) ret := C.git_config_set_string(c.ptr, cname, cvalue) if ret < 0 { return LastError() } return nil }
func (c *Config) SetString(name, value string) (err error) { cname := C.CString(name) defer C.free(unsafe.Pointer(cname)) cvalue := C.CString(value) defer C.free(unsafe.Pointer(cvalue)) runtime.LockOSThread() defer runtime.UnlockOSThread() ret := C.git_config_set_string(c.ptr, cname, cvalue) if ret < 0 { return MakeGitError(ret) } return nil }