From 9309ff5a7f82fa4914dda786c502b0314634b8f7 Mon Sep 17 00:00:00 2001 From: Lemon-miaow Date: Tue, 22 Sep 2026 17:57:03 +0800 Subject: [PATCH] chore: apply the missed S1016 conversions in handlers_users The gofmt/staticcheck commit staged handlers_user.go (singular) for the formatting fix but missed this sibling for its two struct-literal-to- conversion cleanups. --- internal/api/handlers_users.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/internal/api/handlers_users.go b/internal/api/handlers_users.go index 41030fc..6fc7a85 100644 --- a/internal/api/handlers_users.go +++ b/internal/api/handlers_users.go @@ -88,11 +88,7 @@ func (a *API) handleCreateUser(w http.ResponseWriter, r *http.Request) { return } - u, err := a.Repo.CreateUser(r.Context(), CreateUserInput{ - Username: body.Username, - Email: body.Email, - Role: body.Role, - }, p.Email) + u, err := a.Repo.CreateUser(r.Context(), CreateUserInput(body), p.Email) if err != nil { if errors.Is(err, ErrConflict) { writeError(w, r, newError(http.StatusConflict, "already_exists", @@ -156,11 +152,7 @@ func (a *API) handlePatchUser(w http.ResponseWriter, r *http.Request) { return } - u, err := a.Repo.UpdateUser(r.Context(), id, UpdateUserInput{ - Username: body.Username, - Email: body.Email, - Role: body.Role, - }, p.Email) + u, err := a.Repo.UpdateUser(r.Context(), id, UpdateUserInput(body), p.Email) if err != nil { if errors.Is(err, ErrNotFound) { writeError(w, r, newError(http.StatusNotFound, "not_found", "user not found"))