update HTTPStatus helper

This commit is contained in:
Pavel 2023-10-18 15:20:04 +03:00
parent 4c1f29ba01
commit 57d7084b74

View File

@ -24,6 +24,6 @@ func ErrAttr(err any) slog.Attr {
return slog.Any(ErrorAttr, err)
}
func HTTPStatus(code int) (slog.Attr, slog.Attr) {
return slog.Int(HTTPStatusAttr, code), slog.String(HTTPStatusNameAttr, http.StatusText(code))
func HTTPStatus(code int) []any {
return []any{slog.Int(HTTPStatusAttr, code), slog.String(HTTPStatusNameAttr, http.StatusText(code))}
}