Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: run gofmt across all files #261

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Nov 5, 2024

This is the result of manually running gofmt -s -w . in preparation for setting up golangci-lint to actually enforce this

Relates to #158

@G-Rath
Copy link
Collaborator Author

G-Rath commented Nov 5, 2024

I have cherry-picked this into #264 as well, which enables the linter but requires #262 to be landed first - I don't mind which PR gets landed

Copy link
Collaborator

@erikvarga erikvarga left a comment

Choose a reason for hiding this comment

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

Note that we'd have to enable some similar linter internally otherwise any code submitted from there might still have formatting that goes against gofmt formatting (specifically the internal auto-formatter doesn't seem to do the superfluous struct type removal)

@copybara-service copybara-service bot merged commit 46efb81 into google:main Nov 6, 2024
3 checks passed
@G-Rath G-Rath deleted the apply-gofmt branch November 6, 2024 18:08
@G-Rath
Copy link
Collaborator Author

G-Rath commented Nov 6, 2024

specifically the internal auto-formatter doesn't seem to do the superfluous struct type removal

My understanding is that's a result of the -s, which tries to simplify code - I wouldn't be surprised if you've already got a gofmt linter and just need to start passing -s to it?

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