From cf652439b461cac0aa49d6d2c3922a1adfd2cc88 Mon Sep 17 00:00:00 2001 From: noemie Date: Mon, 30 Jan 2023 12:16:57 +0100 Subject: [PATCH] add breaks once id treated --- pg.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pg.go b/pg.go index ae367f7..34e293b 100755 --- a/pg.go +++ b/pg.go @@ -372,7 +372,7 @@ func (t *TableInfo) Delete(record AssRow) error { if key == "id" { values += fmt.Sprintf("%v", element) + "," id = removeLastChar(values) - + break } } query := ("DELETE FROM " + t.Name + " WHERE id = " + id) @@ -392,6 +392,7 @@ func (t *TableInfo) UpdateOrInsert(record AssRow) (int, error) { if key == "id" { sid := fmt.Sprintf("%v", element) id, _ = strconv.Atoi(sid) + break } } if id == -1 {