Skip to content

Commit

Permalink
fix #10: check group length before manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas von Dein committed Feb 10, 2024
1 parent 5c0aadd commit 173a07a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VERSION = $(shell grep VERSION handler.go | head -1 | cut -d '"' -f2)
all: buildlocal

buildlocal:
go build
go build -o example/example example/example.go

clean:
rm -rf $(tool) coverage.out testdata t/out example/example
Expand Down
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (h *Handler) appendAttr(wa map[string]interface{}, a slog.Attr) {
}
wa[name] = innerwa

if a.Key != "" {
if a.Key != "" && len(h.groups) > 0 {
h.groups = h.groups[:len(h.groups)-1]
}

Expand Down

0 comments on commit 173a07a

Please sign in to comment.