Skip to content

Local flag not working with non URL package names #17

@andrazk

Description

@andrazk

In my project I'm using single name like foo instead of full URL package names (e.g. github.com/user/foo). In cases like this local flag is not used and packages are not grouped after 3rd party packages.

Example

Here is a simplified example of the problem.

Go version: 1.15.1
GCI version: 0.2.4

go.mod

module foo

go 1.15

main.go

package main

import (
	"fmt"

	"foo/bar"
)

func main() {
	fmt.Println("foo", bar.Bar())
}

Actual output

> gci -d -local foo main.go
diff -u main.go.orig main.go
--- main.go.orig        2020-09-23 12:48:27.973264200 +0200
+++ main.go     2020-09-23 12:48:27.973822200 +0200
@@ -2,7 +2,6 @@
 
 import (
        "fmt"
-
        "foo/bar"
 )

Expected output

The expected behavior should be for command to pass without errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions