From 4053634b4c7d9df50855a3027dabf1e6bc13a36b Mon Sep 17 00:00:00 2001 From: xfy Date: Mon, 13 Apr 2026 11:25:56 +0800 Subject: [PATCH] =?UTF-8?q?style(utils):=20=E5=AF=B9=E9=BD=90=20HTTPError?= =?UTF-8?q?=20=E5=8F=98=E9=87=8F=E5=A3=B0=E6=98=8E=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对齐预定义 HTTP 错误变量的等号位置,保持代码风格一致。 Co-Authored-By: Claude Opus 4.6 --- internal/utils/httperror.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/utils/httperror.go b/internal/utils/httperror.go index 51fd942..6e0ee16 100644 --- a/internal/utils/httperror.go +++ b/internal/utils/httperror.go @@ -14,14 +14,14 @@ type HTTPError struct { // Predefined common HTTP errors. var ( - ErrNotFound = HTTPError{Message: "Not Found", StatusCode: fasthttp.StatusNotFound} - ErrForbidden = HTTPError{Message: "Forbidden", StatusCode: fasthttp.StatusForbidden} - ErrUnauthorized = HTTPError{Message: "Unauthorized", StatusCode: fasthttp.StatusUnauthorized} - ErrBadGateway = HTTPError{Message: "Bad Gateway", StatusCode: fasthttp.StatusBadGateway} - ErrGatewayTimeout = HTTPError{Message: "Gateway Timeout", StatusCode: fasthttp.StatusGatewayTimeout} - ErrInternalError = HTTPError{Message: "Internal Server Error", StatusCode: fasthttp.StatusInternalServerError} - ErrTooManyRequests = HTTPError{Message: "Too Many Requests", StatusCode: fasthttp.StatusTooManyRequests} - ErrServiceUnavailable = HTTPError{Message: "Service Unavailable", StatusCode: fasthttp.StatusServiceUnavailable} + ErrNotFound = HTTPError{Message: "Not Found", StatusCode: fasthttp.StatusNotFound} + ErrForbidden = HTTPError{Message: "Forbidden", StatusCode: fasthttp.StatusForbidden} + ErrUnauthorized = HTTPError{Message: "Unauthorized", StatusCode: fasthttp.StatusUnauthorized} + ErrBadGateway = HTTPError{Message: "Bad Gateway", StatusCode: fasthttp.StatusBadGateway} + ErrGatewayTimeout = HTTPError{Message: "Gateway Timeout", StatusCode: fasthttp.StatusGatewayTimeout} + ErrInternalError = HTTPError{Message: "Internal Server Error", StatusCode: fasthttp.StatusInternalServerError} + ErrTooManyRequests = HTTPError{Message: "Too Many Requests", StatusCode: fasthttp.StatusTooManyRequests} + ErrServiceUnavailable = HTTPError{Message: "Service Unavailable", StatusCode: fasthttp.StatusServiceUnavailable} ) // SendError sends an HTTP error response to the client.