gitea/models/user
Philip Peterson b0936f4f41
Do not mutate incoming options to RenderUserSearch and SearchUsers (#34544)
This PR changes the `opts` argument in `SearchUsers()` to be passed by
value instead of by pointer, as its mutations do not escape the function
scope and are not used elsewhere. This simplifies reasoning about the
function and avoids unnecessary pointer usage.

This insight emerged during an initial attempt to refactor
`RenderUserSearch()`, which currently intermixes multiple concerns.

Co-authored-by: Philip Peterson <philip-peterson@users.noreply.github.com>
2025-05-27 19:36:02 +00:00
..
avatar_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +00:00
avatar.go Return default avatar url when user id is zero rather than updating database (#34094) 2025-04-02 01:03:27 +00:00
badge.go Add admin API route for managing user's badges (#23106) 2024-03-01 03:23:28 -05:00
block.go Add user blocking (#29028) 2024-03-04 08:16:03 +00:00
email_address_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
email_address.go Support choose email when creating a commit via web UI (#33432) 2025-01-30 01:24:57 +00:00
error.go Remove unused KeyID. (#29167) 2024-02-14 12:50:10 -05:00
external_login_user.go allow synchronizing user status from OAuth2 login providers (#31572) 2024-07-16 20:33:16 +02:00
follow_test.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
follow.go Add user blocking (#29028) 2024-03-04 08:16:03 +00:00
list.go Reduce usage of db.DefaultContext (#27073) 2023-09-14 17:09:32 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
must_change_password.go Refactor error system (#33771) 2025-03-03 05:36:10 +00:00
openid_test.go Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
openid.go Refactor user package (#33423) 2025-01-29 01:14:35 +02:00
redirect_test.go Another round of db.DefaultContext refactor (#27103) 2023-09-25 13:17:37 +00:00
redirect.go Another round of db.DefaultContext refactor (#27103) 2023-09-25 13:17:37 +00:00
search.go Do not mutate incoming options to RenderUserSearch and SearchUsers (#34544) 2025-05-27 19:36:02 +00:00
setting_keys.go Add file tree to file view page (#32721) 2025-03-15 16:26:49 +08:00
setting_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
setting.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
user_list.go Small refactor to reduce unnecessary database queries and remove duplicated functions (#33779) 2025-03-04 18:25:20 +00:00
user_system_test.go Refactor user & avatar (#33433) 2025-01-30 07:33:50 +08:00
user_system.go Fix some migration and repo name problems (#33986) 2025-03-24 20:26:58 -07:00
user_test.go Do not mutate incoming options to RenderUserSearch and SearchUsers (#34544) 2025-05-27 19:36:02 +00:00
user_update.go Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
user.go Fix GetUsersByEmails (#34423) 2025-05-10 11:47:58 -07:00