From 9cf817e614a906c54990c74c28d4a6dcf9465731 Mon Sep 17 00:00:00 2001 From: Runxi Yu <me@runxiyu.org> Date: Wed, 19 Mar 2025 12:19:57 +0800 Subject: Remove underscores from Go code, pt 6 --- users.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'users.go') 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 } -- cgit v1.2.3