Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

life4/awesome-go-code-formatters

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
12 Commits
 
 
 
 

Repository files navigation

Awesome Go code formatters

A curated list of Go code formatters.

Code formatters

  • gofmt -- the default built-in formatter.
  • go-parsefix -- fixes simple parse errors.
  • go-ruleguard -- analysis-based formatter based on custom rules.
  • gocondense -- a gofmt that condenses verbose code.
  • gofumpt -- a stricter gofmt.
  • golines -- fixes long lines.
  • goreturns -- fills in return statements with zero values to match the func return types.
  • keyify -- turns unkeyed struct literals into keyed ones.
  • unconvert -- removes unnecessary type conversions.
  • structslop -- checks struct can be re-arranged fields to get optimal struct size (can reduce memory use in large collections of struct instances) -- Medium article here.

Imports formatters

  • dedupimport -- fixes duplicate named/unnamed imports that have the same import path
  • gci -- controls package import order and make it always deterministic.
  • goimports-reviser -- goimports alternative.
  • goimports -- adds missing imports and removes unused ones.

Code generators

  • stringer -- generates string representation for integer constants.

See also

Contributors

Morty Proxy This is a proxified and sanitized view of the page, visit original site.