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

[post] gommon format: A customized goimports for formatting go code #56

Open
at15 opened this issue Aug 7, 2020 · 0 comments
Open

[post] gommon format: A customized goimports for formatting go code #56

at15 opened this issue Aug 7, 2020 · 0 comments

Comments

@at15
Copy link
Member

at15 commented Aug 7, 2020

Type

  • request post from @at15

Related

Description

goimports works better than gofmt because it groups import. However, sometimes I want to enforce extra rules like putting proto imports at the bottom, group imports from current project together, warn/error if some packages are imported e.g. github.com/pkg/errors.

The code is still in progress in dyweb/gommon#127 (well 5+ months PR ... 咕咕.... And the post plans to cover the following

  • how gofmt and goimports works
  • how to parse go code, basic struct of go ast
  • modify go ast and dump it back to text
  • why we design gommon format this way

Update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant