Skip to content

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

Closed
@yutianwu

Description

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.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions