Potential import collision: import path should be "github.com/go-acme/lego", not "github.com/xenolf/lego".
KateGo520 opened this issue · 3 comments
Background
The lego
has already renamed it’s import path from "github.com/xenolf/lego" to "github.com/go-acme/lego".
But gomodules/dns
still used the old path:
https://github.com/alphagov/paas-cf/blob/master/tools/user_emails/go.mod#L17
github.com/xenolf/lego v2.5.0+incompatible
When you use the old path "github.com/xenolf/lego" to import the lego
, it will be very easy to reintroduce lego
through the import statements "import github.com/go-acme/lego" in the go source file of lego
.
https://github.com/go-acme/lego/blob/v2.5.0/acme/api/authorization.go#L6
package main
import (
"fmt"
"github.com/go-acme/lego"
"net/http"
)
…
The "github.com/go-acme/lego" and "github.com/xenolf/lego" are the same repos. This will work in isolation, bring about potential risks and problems.
Solution
Replace all the old import paths, change "github.com/xenolf/lego"
to "github.com/go-acme/lego"
.
Where did you import it: https://github.com/alphagov/paas-cf/search?q=github.com%2Fxenolf%2Flego&unscoped_q=github.com%2Fxenolf%2Flego
Hi Kate,
Thanks for flagging this up to us, it's much appreciated. The tool the import appears in is used very sparingly, so this should be a tiny fix. I'll raise a PR later today to make the change.