fix(logring): inline empty-key groups - #135
Merged
Merged
Conversation
dhodhoo
force-pushed
the
fix/logring-empty-group
branch
from
August 18, 2026 10:03
ec62b25 to
3056b5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
logringcurrently adds a separator when flattening an empty-keyslog.Groupunder an existing group prefix. This can produce malformed retained fields such as:instead of:
The
slog.Handlercontract specifies that groups with an empty key should have their attributes inlined.This change keeps the existing prefix unchanged for empty-key groups while preserving the current behavior for named groups.
Regression coverage includes empty groups under a named prefix, nested empty groups, and consecutive empty groups.
No related issue; this was found while reviewing the structured log flattening path.
Type of change
Checklist
go build ./...go vet ./...cleango test ./...(CI also runs-race)README.md,docs/guides/) — not applicable; no public config or documentation changes.env, orconfig.jsoncontentNotes
Targeted
logringtests pass with the race detector, and the full local race suite passes sequentially withgo test -race -p 1 ./....