aboutsummaryrefslogtreecommitdiff
path: root/users.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:26:57 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:26:57 +0800
commit20b4fe0c59357a433042732d46e38da9c3d14c3b (patch)
tree537d7d450701a839802b1d57a82bd07324dcba90 /users.go
parentmisc: Move utils.go's string function to misc (diff)
downloadforge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.gz
forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.tar.zst
forge-20b4fe0c59357a433042732d46e38da9c3d14c3b.zip
database shall no longer be a global variable
Diffstat (limited to 'users.go')
-rw-r--r--users.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/users.go b/users.go
index f0dabce..1b31f3a 100644
--- a/users.go
+++ b/users.go
@@ -12,10 +12,10 @@ import (
// addUserSSH adds a new user solely based on their SSH public key.
//
// TODO: Audit all users of this function.
-func addUserSSH(ctx context.Context, pubkey string) (userID int, err error) {
+func (s *server) addUserSSH(ctx context.Context, pubkey string) (userID int, err error) {
var txn pgx.Tx
- if txn, err = database.Begin(ctx); err != nil {
+ if txn, err = s.database.Begin(ctx); err != nil {
return
}
defer func() {