Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Use dependencies in vendor/ instead of downloading them #296

@amuttsch

Description

@amuttsch

I have a Go project that uses modules and stores its dependencies in the vendor/ folder. In our CI pipeline, we install gomock and run it via //go:generate mockgen -source ./foo/service.go -destination gen/foo/mocks.go -package foo.

gomock then tries to download all dependencies from its source repositories instead of using the vendor folder. This is problematic for us as we have some dependencies in a private repo that uses self signed certificates. Thats why we want to use the vendor/ folder.

We execute go generate -mod vendor to trigger the generation, we tried prefixing it with GOFLAGS=-mod=vendor and using -build_flags "-mod vendor" , but gomock always downloads all dependencies.

How can we tell gomock to look for dependencies in the vendor folder first before downloading them? Thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions