diff --git a/Makefile b/Makefile index 120cf64..ba0d06a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/handler.go b/handler.go index b5cf812..910f642 100644 --- a/handler.go +++ b/handler.go @@ -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] }