From f8ac95e56f3563461675f37d8c20cb818176fdc2 Mon Sep 17 00:00:00 2001 From: asamuj <105436033+asamuj@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:30:07 +0800 Subject: [PATCH] log: remove unused parameter (#30432) --- log/format.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/log/format.go b/log/format.go index 54c071b908..e7dd8a4099 100644 --- a/log/format.go +++ b/log/format.go @@ -79,7 +79,7 @@ func (h *TerminalHandler) format(buf []byte, r slog.Record, usecolor bool) []byt } func (h *TerminalHandler) formatAttributes(buf *bytes.Buffer, r slog.Record, color string) { - writeAttr := func(attr slog.Attr, first, last bool) { + writeAttr := func(attr slog.Attr, last bool) { buf.WriteByte(' ') if color != "" { @@ -107,11 +107,11 @@ func (h *TerminalHandler) formatAttributes(buf *bytes.Buffer, r slog.Record, col var n = 0 var nAttrs = len(h.attrs) + r.NumAttrs() for _, attr := range h.attrs { - writeAttr(attr, n == 0, n == nAttrs-1) + writeAttr(attr, n == nAttrs-1) n++ } r.Attrs(func(attr slog.Attr) bool { - writeAttr(attr, n == 0, n == nAttrs-1) + writeAttr(attr, n == nAttrs-1) n++ return true })