You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
httplog.LogEntry should return *slog.Logger instead of slog.Logger because then, the returned value implements interfaces for the slog API. Reason is that slog’s Logger methods need pointer receivers.
Note that *slog.Logger is used in slog’s own code all over the place, and even httplog’s LogEntry needs to de-reference in order to return a plain slog.Logger.
The text was updated successfully, but these errors were encountered:
bronger
changed the title
LogEntry shoudl return a pointer
LogEntry should return a pointer
Mar 1, 2024
httplog.LogEntry
should return*slog.Logger
instead ofslog.Logger
because then, the returned value implements interfaces for the slog API. Reason is that slog’s Logger methods need pointer receivers.Note that
*slog.Logger
is used in slog’s own code all over the place, and even httplog’sLogEntry
needs to de-reference in order to return a plainslog.Logger
.The text was updated successfully, but these errors were encountered: