+
Skip to content

[go] goimport that check and replace specific import #118

Open
@at15

Description

@at15

Now I use goimport instead of gofmt when formatting code because it checks import and do the sorting. However I have some new use cases:

  • replace specific import because they were added by IDE when there are imports with similar name. Especially when your dependency depends on its own fork of your other dependency, e.g. assert.
  • group import into multiple groups, e.g. protobuf, third party dependency, packages inside the project
  • enforce import alias, e.g. protobuf packages should be named to xxxpb

Should put it under gommon fmt or gommon gofmt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载