Skip to content

import is duplicated in certain situation #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
youxkei opened this issue Jun 13, 2023 · 0 comments
Open

import is duplicated in certain situation #2

youxkei opened this issue Jun 13, 2023 · 0 comments

Comments

@youxkei
Copy link
Contributor

youxkei commented Jun 13, 2023

Version: v1.1.0
The reproduction code: https://github.com/youxkei/goimportz-bug/tree/f2953b59fedf2fe37b3965d2007ea078765d9c25

$ cat a.go
package main

import (
	"example.com/hoge-a"
	"example.com/hoge-b"
)

func f()  {
	hogea.F()
}

$ go run github.com/zchee/goimportz/cmd/goimportz a.go
package main

import (
	"example.com/hoge-a"
	hogea "example.com/hoge-a"
)

func f() {
	hogea.F()
}

In the above situation, gimportz somehow outputs source code in which "hoge-a" package is imported twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant