f-8: clean: use kv func for db bin #8
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
97132550b0
commit
c2664e94fa
1 changed files with 1 additions and 3 deletions
|
|
@ -52,9 +52,7 @@ func AddInDB(dbName string, line string) error {
|
||||||
id := strings.Split(line, ";")[0] + "/bash"
|
id := strings.Split(line, ";")[0] + "/bash"
|
||||||
key := []byte(dbName + "/" + id)
|
key := []byte(dbName + "/" + id)
|
||||||
|
|
||||||
return DB.Update(func(txn *badger.Txn) error {
|
return kv.AddInDB(DB, string(key), line)
|
||||||
return txn.Set(key, []byte(line))
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeleteInDB(dbName, id string) error {
|
func DeleteInDB(dbName, id string) error {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue