Closed KateGo520 closed 4 years ago
@rocketlaunchr-cto @propersam Could you help me review this issue? Thx :p
I'll have a look at it within 2 days. Should be an easy fix.
done
@pjebs Thank you for your contribution.
@KateGo520 I may have to revert this because it looks like go test
doesn't work with the replace directive.
I think your only concern is deduplication of essentially the same package (increase file size), which is not a "collision risk" in Go.
By the looks of it, you may need to file a bug report with regards to go test
so it accepts the replace directive in this scenario, or lobby all packages to correct their path dependency to the new path and/or (perhaps in some cases) use the Go alias
declaration feature.
Background
Repo
rocketlaunchr/dataframe-go
used the old path to importgotestyourself
indirectly. This caused thatgithub.com/gotestyourself/gotestyourself
andgotest.tools
coexist in this repo: https://github.com/rocketlaunchr/dataframe-go/blob/master/go.mod (Line 20 & 40)That’s because the
gotestyourself
has already renamed it’s import path from "github.com/gotestyourself/gotestyourself" to "gotest.tools". When you use the old path "github.com/gotestyourself/gotestyourself" to import thegotestyourself
, will reintroducesgotestyourself
through the import statements "import gotest.tools" in the go source file ofgotestyourself
.https://github.com/gotestyourself/gotest.tools/blob/v2.2.0/fs/example_test.go#L8
"github.com/gotestyourself/gotestyourself" and "gotest.tools" are the same repos. This will work in isolation, bring about potential risks and problems.
Solution
Add replace statement in the go.mod file:
Then clean the go.mod.