-
Notifications
You must be signed in to change notification settings - Fork 112
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
Issues Generating Client After go mod tidy #160
Comments
Thanks for the report! This looks to be golang/go#45552; see in particular this comment. In short, if you want to be able to This is ultimately a Go modules problem so we can't fix it, but I'll leave this issue since we should probably mention it in genqlient docs. We'll need to figure out the best thing to recommend. |
@benjaminjkraft Thank you for the help. Very much appreciated. I will check if the provided workaround int he comment works 👍 |
Just came back here and can report that the workaround did in fact worked. I use a //go:build tools
// +build tools
package client
import (
_ "github.com/Khan/genqlient"
) This fixed the issue. |
This came up in #160, and will surely come up again. I hope the Go folks figure out something better here, but until such time...
This came up in #160, and will surely come up again. I hope the Go folks figure out something better here, but until such time...
Disclaimer: I am not sure how to fix this or if this is a issue with
go mod
.Describe the bug
go get github.com/Khan/genqlient
go.mod
contains several indirect dependencies required bygo generate .
(see below)go generate .
successfullygo mod tidy
, which removes all the required indirect dependencies of genqlient (see below).go generate .
anymore, because dependencies are missing (see error below)Error:
To Reproduce
go generate .
generated.go
should be created (you can also rungo run .
to verify that the generated client works)go mod tidy
go.mod
, most indirect dependencies have been removedgo generate .
againExpected behavior
When running
go mod tidy
required dependencies are not removed.genqlient version
v0.3.0
Additional context
go.mod
aftergo get github.com/Khan/genqlient
:go.mod
after runninggo mod tidy
:go-mod-tidy-issue.zip
The text was updated successfully, but these errors were encountered: