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
//go:generate go run github.com/99designs/gqlgen
At the top which will run a package to generate some files for me. I'm running all this within a docker container using Go Mods but it's in vendor mode.
Inside the docker container I have GOFLAGS=-mod=vendor to run all commands by using the vendor folder
The issues here lies with when I try to run go generate ./... inside the docker container. It returns the error:
package github.com/99designs/gqlgen: no Go files in /code/project/vendor/github.com/99designs/gqlgen
I'm assuming when the go generate -mod=vendor ./... command tries to run go run -mod=vendor github.com/99designs/gqlgen it can't find no Go files within the package.
What did you expect to see?
I expected for the go run command to work when vendoring packages.
What did you see instead?
The command didn't work it just returned:
package github.com/99designs/gqlgen: no Go files in /code/project/vendor/github.com/99designs/gqlgen
The text was updated successfully, but these errors were encountered:
coderste
changed the title
No go files in: when running go run with vendor folder
No go files in package: when running go run with vendor folder
Jul 23, 2019
if the containing package is intended for import by go get, once the file is generated (and tested!) it must be checked into the source code repository to be available to clients.
go mod vendor vendors in only those packages that are needed to build (using go build) and test (using go test) the packages in the main module. So it is expected that go generate does not work in general with -mod=vendor.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I have a file with
At the top which will run a package to generate some files for me. I'm running all this within a docker container using Go Mods but it's in vendor mode.
Inside the docker container I have
GOFLAGS=-mod=vendor
to run all commands by using the vendor folderThe issues here lies with when I try to run
go generate ./...
inside the docker container. It returns the error:I'm assuming when the
go generate -mod=vendor ./...
command tries to rungo run -mod=vendor github.com/99designs/gqlgen
it can't find no Go files within the package.What did you expect to see?
I expected for the
go run
command to work when vendoring packages.What did you see instead?
The command didn't work it just returned:
The text was updated successfully, but these errors were encountered: