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

It would be better to use goimports to organize imported packages #2766

Closed
yutianwu opened this issue Nov 12, 2018 · 3 comments
Closed

It would be better to use goimports to organize imported packages #2766

yutianwu opened this issue Nov 12, 2018 · 3 comments

Comments

@yutianwu
Copy link
Contributor

yutianwu commented Nov 12, 2018

For now, we do not use tools to organize imported packages.

For example, baseapp/helpers.go

import (
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/tendermint/tendermint/abci/server"
	abci "github.com/tendermint/tendermint/abci/types"
	cmn "github.com/tendermint/tendermint/libs/common"
)

the proper format should be

import (
	cmn "github.com/tendermint/tendermint/libs/common"

	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/tendermint/tendermint/abci/server"
	abci "github.com/tendermint/tendermint/abci/types"
)

the general idea to organize imported packages is to group imported packages as three groups:

  1. std packages
  2. third party pacakges
  3. self packages

so it would be better to add goimports tools to makefile.

@alexanderbez
Copy link
Contributor

As I already use goimports, I'm a big fan of this 👍

@yutianwu
Copy link
Contributor Author

As I already use goimports, I'm a big fan of this 👍

yeah, it would be better to use tools for this stuff :)

@tac0turtle
Copy link
Member

Seems goimports has been added, @alexanderbez can we close this issue?

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

No branches or pull requests

3 participants