Skip to content

Conversation

alexandear
Copy link
Contributor

Let's assume example/simple/main.go contains a lint issue fmt.Printf("Enter GitHub username: ") and we run ./script/lint.sh.

Before (duplicated example in the issued file path):

$ ./script/lint.sh
linting .
0 issues.
linting example
/Users/alexandear/src/github.com/google/go-github/example
example/example/simple/main.go:27:2: unnecessary-format: unnecessary use of formatting function "fmt.Printf", you can replace it with "fmt.Print" or "fmt.Println" (revive)
        fmt.Printf("Enter GitHub username: ")
        ^
1 issues:
* revive: 1
failed linting example

After:

$ ./script/lint.sh
linting .
0 issues.
linting example
/Users/alexandear/src/github.com/google/go-github/example
example/simple/main.go:27:2: unnecessary-format: unnecessary use of formatting function "fmt.Printf", you can replace it with "fmt.Print" or "fmt.Println" (revive)
        fmt.Printf("Enter GitHub username: ")
        ^
1 issues:
* revive: 1
failed linting example

The fix is simple: remove --path-prefix option as not needed in v2. See https://golangci-lint.run/product/migration-guide/#runrelative-path-mode

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @alexandear!
LGTM.
Merging.

Copy link

codecov bot commented Jul 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.25%. Comparing base (a81b973) to head (e450da7).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3656   +/-   ##
=======================================
  Coverage   91.25%   91.25%           
=======================================
  Files         184      184           
  Lines       16311    16311           
=======================================
  Hits        14884    14884           
  Misses       1245     1245           
  Partials      182      182           

☔ 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.

@gmlewis gmlewis merged commit 9f2b91b into google:master Jul 28, 2025
7 checks passed
@alexandear alexandear deleted the chore/remove-path-prefix branch July 28, 2025 16:08
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