golang / mock

GoMock is a mocking framework for the Go programming language.
Apache License 2.0
9.28k stars 610 forks source link

How about to add an official mockgen docker image? #563

Closed kulti closed 3 years ago

kulti commented 3 years ago

Requested feature I'd like to generate mocks using docker image like this docker run -v $(PWD):/app golang/mock mockgen -destination=mock_db_test.go -package=app_test . UsersDB.

Why the feature is needed Different environments can have different versions of mockgen. It will be better to generate mocks via docker image.

(Optional) Proposed solution This repo already uses goreleaser. So it should not be so hard to add docker image publishing.

codyoss commented 3 years ago

Hey thanks for the request. At this time I do not think that publishing a Docker image with just mockgen would provide enough value. If you have a CI system that is based on Docker I would recommend that it download one of the published binaries that we provide with our releases. Example.

kulti commented 3 years ago

Thank you for your suggestion. Code is generated by developers, not in CI. Configuring multiple environments with different OS and users' preferences is not a simple task :)

I understand your point. For me, the docker image with mockgen has enough value. We have our own docker registry. I write Dockerfile and use docker image locally.