func (self *KcDb) Close() error { defer C.kcdbdel(self.cdb) if C.kcdbclose(self.cdb) == kcFalse { return errors.New(fmt.Sprintf("close: %s", C.GoString(C.kcecodename(C.kcdbecode(self.cdb))))) } return nil }
// Closes the database, make sure you always call this method after using the database. // // You can do it using the defer statement: // // db := Open("my_db.kch", WRITE) // defer db.Close() func (d *DB) Close() { C.kcdbclose(d.db) C.kcdbdel(d.db) }
func (kc *KCDB) Close() (err error) { if C.kcdbclose(kc.db) == 0 { err = kc.error() } return }