Skip to content

Include package dir in trimmed caller for major-version modules - #1559

Open
larrasket wants to merge 1 commit into
uber-go:masterfrom
larrasket:trimmedpath-major-version
Open

Include package dir in trimmed caller for major-version modules#1559
larrasket wants to merge 1 commit into
uber-go:masterfrom
larrasket:trimmedpath-major-version

Conversation

@larrasket

Copy link
Copy Markdown

For a module with a major-version suffix, the file path in the module cache has the form .../go-pkg/v2@v2.0.3/file.go, so TrimmedPath kept only the version directory and reported callers like "v2@v2.0.3/file.go:9", dropping the package name.

When the penultimate path element looks like a major-version suffix (v@v.), keep one more directory, producing "go-pkg/v2@v2.0.3/file.go:9".

Fixes #1209

For a module with a major-version suffix, the file path in the module
cache has the form .../go-pkg/v2@v2.0.3/file.go, so TrimmedPath kept
only the version directory and reported callers like
"v2@v2.0.3/file.go:9", dropping the package name.

When the penultimate path element looks like a major-version suffix
(v<digits>@v<digits>.), keep one more directory, producing
"go-pkg/v2@v2.0.3/file.go:9".

Fixes uber-go#1209
@CLAassistant

CLAassistant commented Jul 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.62%. Comparing base (5b81b37) to head (d9c2619).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1559   +/-   ##
=======================================
  Coverage   98.62%   98.62%           
=======================================
  Files          53       53           
  Lines        3045     3061   +16     
=======================================
+ Hits         3003     3019   +16     
  Misses         34       34           
  Partials        8        8           

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect caller when logs originate from modules with a major version suffix

2 participants