You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Up to V2, it was very handy to be able to run, e.g., the schemagen tool with go run (go run github.com/scylladb/gocqlx/v2/cmd/schemagen@latest) or to install it with go install.
Since V3, this is no longer possible, as go would complain:
go: github.com/scylladb/gocqlx/v3/cmd/schemagen@latest (in github.com/scylladb/gocqlx/[email protected]):
The go.mod file for the module providing named packages contains one or
more replace directives. It must not contain directives that would cause
it to be interpreted differently than if it were the main module.
If that module has a go.mod file, it must not contain directives that
would cause it to be interpreted differently if the module were the main
module. In particular, it must not contain replace or exclude
directives.
(A longer discussion about this can be found in this issue.)
Thus, the reason for this to occur in the case of gocqlx is the replace directive that was added in v3:
Unfortunately for now there is no way to use scylladb/gocql in the imports, see the discussion here: scylladb/gocql#161. Changing module name for scylladb/gocql is a breaking change so it would require major release in scylladb/gocql repo, but this would not happen soon, here is the issue for changes that require new version release scylladb/gocql#232.
Unfortunately I do not have any quick workaround to make using go install possible @dkropachev any thoughts?
@alfa-alex , Thanks for bringing this to our attention, unfortunately, it won't go away until scylladb/gocql#232 is merged and we need at least a year to make it happen.
Luckily there is a workaround:
git clone [email protected]:scylladb/gocqlx.git`
cd gocqlx/cmd/schemagen/
go install .
Up to V2, it was very handy to be able to run, e.g., the
schemagen
tool withgo run
(go run github.com/scylladb/gocqlx/v2/cmd/schemagen@latest
) or to install it withgo install
.Since V3, this is no longer possible, as
go
would complain:This is specified in golang/go#40276:
(A longer discussion about this can be found in this issue.)
Thus, the reason for this to occur in the case of
gocqlx
is thereplace
directive that was added inv3
:I want to raise awareness of this, as the ability to run
schemagen
withgo run
(or install it withgo install
) has been very useful to me.Unfortunately, I cannot propose an immediate mitigation of this issue (other than replacing all imports to use the
scylladb/gocql
module directly).The text was updated successfully, but these errors were encountered: