goimports does not sort imports as expected

545 Views Asked by At

I have created dummy file (which is called file1.go) with chaotic imports statements:

package somepackage

import (
        "context"

        "github.com/jmoiron/sqlx"

        "fmt"

        "github.com/google/uuid"
)

func PrintMe() {
        _ = context.Background()
        fmt.Println("this is from somepackage...")
        sqlx.Rebind(1, "")
        _ = uuid.UUID{}
}

Why goimports does not sort such imports and does not group it?

I run command as follows:

goimports file1.go
0

There are 0 best solutions below