log: remove unused parameter #30432 (#1509)

Co-authored-by: asamuj <105436033+asamuj@users.noreply.github.com>
This commit is contained in:
Daniel Liu 2025-09-17 08:26:34 +08:00 committed by GitHub
parent 993c60f16c
commit ba9fa91375
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
})