Skip to content

fix: set resolved LogValue back to the original attr.Value#34

Merged
samber merged 1 commit into
samber:mainfrom
AVM-Martin:fix/log-valuer
Feb 1, 2026
Merged

fix: set resolved LogValue back to the original attr.Value#34
samber merged 1 commit into
samber:mainfrom
AVM-Martin:fix/log-valuer

Conversation

@AVM-Martin
Copy link
Copy Markdown
Contributor

LogValuer does not always converted into a GroupValue, and ReplaceAttrFn can be nil.
So we need to set the resolved value back to the original attr.Value

type Token string

func (Token) LogValue() slog.Value {
	return slog.StringValue("REDACTED_TOKEN")
}

Refs: https://cs.opensource.google/go/go/+/refs/tags/go1.25.6:src/log/slog/example_logvaluer_secret_test.go;l=12-19

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.68%. Comparing base (d9bc3e1) to head (bfb2486).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
+ Coverage   54.33%   54.68%   +0.35%     
==========================================
  Files           4        4              
  Lines         254      256       +2     
==========================================
+ Hits          138      140       +2     
  Misses        113      113              
  Partials        3        3              
Flag Coverage Δ
unittests 54.68% <100.00%> (+0.35%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@samber samber merged commit a49b298 into samber:main Feb 1, 2026
5 checks passed
@AVM-Martin AVM-Martin deleted the fix/log-valuer branch February 2, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants