dyweb / blog

Dongyue Tech Blog
https://blog.dongyueweb.com
14 stars 7 forks source link

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

Open at15 opened 4 years ago

at15 commented 4 years ago

Type

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 https://github.com/dyweb/gommon/pull/127 (well 5+ months PR ... 咕咕.... And the post plans to cover the following

Update