-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Description
Hi,
I would like to automatically group the imported packages into 4 groups.
// standard packages
// third party packages
// company private packages
// current code base
It can't be done by the current goimports, because the -local for the goimports only gets a string.
For example, I have a go source file below:
package Foo
import (
"fmt"
"github.com/google/uuid"
"github.com/company/private/database"
"github.com/current/codebase/pkg/utils"
)By using goimports -local github.com/current foo.go, I will have:
package Foo
import (
"fmt"
"github.com/google/uuid"
"github.com/company/private/database"
"github.com/current/codebase/pkg/utils"
)I want goimports can support the arguments like: goimports -local github.com/current -local github.com/company foo.go.
The expectation is as below.
package Foo
import (
"fmt"
"github.com/google/uuid"
"github.com/company/private/database"
"github.com/current/codebase/pkg/utils"
)My requested feature is NOT a breaking change, it's back compatible.
I think it should be a simple change. If you are ok for the feature, I will provide the implementation with testing.
TIA.
violin0622, obalunenko, cshubhamrao, t0rr3sp3dr0, nviktorov and 2 more
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Incoming