Пример #1
0
// Clear clears the value associated with a path. Intermediate entries
// are created if they don't exist.
func (a Augeas) Clear(path string) error {
	cPath := C.CString(path)
	defer C.free(unsafe.Pointer(cPath))

	ret := C.aug_set(a.handle, cPath, nil)

	if ret == -1 {
		return a.error()
	}

	return nil
}
Пример #2
0
// Set the value associated with a path. Intermediate entries are
// created if they don't exist.
func (a Augeas) Set(path, value string) error {
	cPath := C.CString(path)
	defer C.free(unsafe.Pointer(cPath))

	cValue := C.CString(value)
	defer C.free(unsafe.Pointer(cValue))

	ret := C.aug_set(a.handle, cPath, cValue)

	if ret == -1 {
		return a.error()
	}

	return nil
}