From ecf8d75c68e23190ec4bb4981d57cad3f798131e Mon Sep 17 00:00:00 2001 From: ice-myles <96409608+ice-myles@users.noreply.github.com> Date: Sat, 19 Oct 2024 14:27:41 +0300 Subject: [PATCH] Linter fix --- users/user_growth.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/users/user_growth.go b/users/user_growth.go index ff05ee1c..5a263632 100644 --- a/users/user_growth.go +++ b/users/user_growth.go @@ -218,7 +218,9 @@ func (r *repository) incrementOrDecrementTotalUsers(ctx context.Context, date *t } sql := fmt.Sprintf(`INSERT INTO global (key, value) VALUES %[2]v ON CONFLICT (key) DO UPDATE - SET value = (select GREATEST(total.value %[1]v 1,0) FROM global total WHERE total.key = '%[3]v' FOR UPDATE)`, operation, strings.Join(sqlParams, ","), params[0]) + SET value = ( + select GREATEST(total.value %[1]v 1,0) FROM global total WHERE total.key = '%[3]v' FOR UPDATE + )`, operation, strings.Join(sqlParams, ","), params[0]) if _, err := storage.Exec(ctx, r.db, sql, params...); err != nil && !storage.IsErr(err, storage.ErrNotFound) { return errors.Wrapf(err, "failed to update global.value to global.value%v1 of key='%v', for params:%#v ", operation, totalUsersGlobalKey, params) } else if err != nil && errors.Is(err, storage.ErrSerializationFailure) {