Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/gofmt: one-method interfaces should be able to be on one line #21952
What did you do?
What did you expect to see?
Formatting doesn't change anything.
What did you see instead?
Formatting changes the non-empty interface to span multiple lines.
I hate to complain about gofmt but this is the one thing that bugs me about it.
It comes up for me whenever I'm doing type assertions to another interface.
I want to write
The workaround isn't hard, but I end up with code like
which adds more steps to reading the line than I feel should be necessary for a common operation.