incu6us / goimports-reviser

Right imports sorting & code formatting tool (goimports alternative)
MIT License
611 stars 72 forks source link

Cannot sort imports correctly in some case #101

Closed pythonberg1997 closed 1 year ago

pythonberg1997 commented 1 year ago

For example(local module is github.com/cosmos/cosmos-sdk), I got this after run goimports-reviser:

import (
    "encoding/json"
    "errors"
    "fmt"
    "net/url"
    "os"
    "path/filepath"
    "strconv"
    "strings"
    "time"

    upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
    upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
    "github.com/rs/zerolog"

    cverrors "github.com/cosmos/cosmos-sdk/cosmovisor/errors"
)

But it should be like this right?:

import (
    "encoding/json"
    "errors"
    "fmt"
    "net/url"
    "os"
    "path/filepath"
    "strconv"
    "strings"
    "time"

    "github.com/rs/zerolog"

    cverrors "github.com/cosmos/cosmos-sdk/cosmovisor/errors"
    upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
    upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)