aboutsummaryrefslogtreecommitdiff
path: root/users.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-19 12:19:57 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-19 12:19:57 +0800
commit9cf817e614a906c54990c74c28d4a6dcf9465731 (patch)
tree6d26a521af68c03f5f883a8ebe16b8842fd0db22 /users.go
parentRemove underscores from Go code, pt 5 (diff)
downloadforge-9cf817e614a906c54990c74c28d4a6dcf9465731.tar.gz
forge-9cf817e614a906c54990c74c28d4a6dcf9465731.tar.zst
forge-9cf817e614a906c54990c74c28d4a6dcf9465731.zip
Remove underscores from Go code, pt 6
Diffstat (limited to '')
-rw-r--r--users.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/users.go b/users.go
index 98a5efe..f8dae4b 100644
--- a/users.go
+++ b/users.go
@@ -9,7 +9,7 @@ import (
"github.com/jackc/pgx/v5"
)
-func addUserSSH(ctx context.Context, pubkey string) (user_id int, err error) {
+func addUserSSH(ctx context.Context, pubkey string) (userID int, err error) {
var tx pgx.Tx
if tx, err = database.Begin(ctx); err != nil {
@@ -19,11 +19,11 @@ func addUserSSH(ctx context.Context, pubkey string) (user_id int, err error) {
_ = tx.Rollback(ctx)
}()
- if err = tx.QueryRow(ctx, `INSERT INTO users (type) VALUES ('pubkey_only') RETURNING id`).Scan(&user_id); err != nil {
+ if err = tx.QueryRow(ctx, `INSERT INTO users (type) VALUES ('pubkey_only') RETURNING id`).Scan(&userID); err != nil {
return
}
- if _, err = tx.Exec(ctx, `INSERT INTO ssh_public_keys (key_string, user_id) VALUES ($1, $2)`, pubkey, user_id); err != nil {
+ if _, err = tx.Exec(ctx, `INSERT INTO ssh_public_keys (key_string, user_id) VALUES ($1, $2)`, pubkey, userID); err != nil {
return
}