Repository navigation
Show the real function name in logs from generic functions - #2102
Merged
alex-zaitsev merged 1 commit intoOct 14, 2026
Merged
Conversation
Caller() shortens the frame name by turning dots into slashes and taking path.Base. Go reports generic functions as pkg.Fn[...], so the dots in "[...]" became slashes too and the name came out as "]", e.g. retry warnings from GetWithRetry logged as "]():". Trim the "[...]" first. Fixes Altinity#2101
alex-zaitsev
self-requested a review
October 14, 2026 13:06
alex-zaitsev
approved these changes
Oct 14, 2026
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.
Fixes #2101
Log lines from generic functions showed
]instead of the function name, e.g.]():transient API error: retrying ...fromGetWithRetry.Caller()turns the dots in a function name into slashes and keeps the last part. Go names generic functions likepkg.GetWithRetry[...], so the...turned into slashes too and only]was left. This strips the[...]first.Added a small test that checks a normal function and a generic one. The generic case fails without the fix (
got "]") and passes with it.