Skip to content

Commit

Permalink
chore(logs): log wraning
Browse files Browse the repository at this point in the history
  • Loading branch information
Avantol13 authored Feb 14, 2025
1 parent 617e4e7 commit feccfa5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arborist/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ func userWithName(db *sqlx.DB, name string) (*UserFromQuery, error) {
err := db.Select(
&users,
stmt,
strings.ToLower(name), // $1
AnonymousGroup, // $2
strings.ToLower(name), // $1
AnonymousGroup, // $2
LoggedInGroup, // $3
)
if err != nil {
Expand All @@ -147,6 +147,10 @@ func userWithName(db *sqlx.DB, name string) (*UserFromQuery, error) {
if len(users) == 0 {
return nil, nil
}
if len(users) > 1 {
fmt.Printf("WARN: More than one record of the user `%s` exists (likely with different cases). Returning the first matching record",
name)
}
user := users[0]
return &user, nil
}
Expand Down

0 comments on commit feccfa5

Please sign in to comment.