Open perrydunn opened 3 years ago
cc @heschi @bradfitz
goimports has a hardcoded rule for go-
prefixes; I suppose it could expand to cover golang-
. Other than that, this is working as intended.
Thanks. Will these rules be documented (so that, for example, people coming up with names can bear them in mind)? If they're already documented, I apologise, though I haven't been able to find such references.
It's not documented anywhere, and I suppose it wouldn't hurt if there's a reasonable place to put it. None occur to me offhand though. Is there somewhere in particular you would have expected to find a description?
Perhaps in the godoc overview?
Wow! At least I found the answer, why I'm getting
import (
"log"
dotenv "github.com/dsh2dsh/expx-dotenv"
)
instead of
import (
"log"
"github.com/dsh2dsh/expx-dotenv"
)
It really should be documented somewhere. Hmm... now I have a question. Why does it add redundant alias? I thought Go imports github.com/dsh2dsh/expx-dotenv
and makes it accessible as dotenv
by default? Yes, I just tried and can confirm it works without alias. Could somebody explain the reason or give a link to an explanation? Thanks.
See #28428.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes (compiled with go1.16.5 too)
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/8VOphLYHxto
What did you expect to see?
No redundant alias
What did you see instead?
Redundant alias added