Skip to content
Snippets Groups Projects

all: remove Go parameter names for func defs

Created by: rvantonder

This PR is just a proposal for discussion:

How do people feel about function definition style like:

type foo func(name type) versus just type foo func(type) ?

I think I prefer the latter, but out of habit tend to write the former. The name usually doesn't add much to the signature (like ctx context.Context ok lol), and when I go back to my code and see what I did I tend to "fix it" and delete name.

More examples in our code base where the name can go away: https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+type+:%5B%5Bw%5D%5D+func%28:%5B%5Bx%5D%5D+:%5By:e%5D%29+lang:go&patternType=structural

This PR removes all unneeded param names in function type signatures.

comby \
'type :[[w]] func(:[[x]] :[y:e])' \
'type :[w] func(:[y:e])' \
'' \
-rg "-g '*.go'" -stats -i

Merge request reports

Approval is optional

Closed by avatar (Oct 9, 2025 2:10am UTC)

Merge details

  • The changes were not merged into main.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading