Skip to content
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

Support for archive mode #125

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Support for archive mode #125

wants to merge 8 commits into from

Conversation

sywhang
Copy link
Contributor

@sywhang sywhang commented Nov 21, 2023

This adds support for a 3rd option for creating mocks after reflect and source-mode: the archive mode. Archive mode lets you load archive files to create mocks. This can come in handy for writing Bazel rules that produce intermediary archive files and automatically codegen mocks in Bazel environments.

@sywhang sywhang requested review from r-hang and JacobOaks November 23, 2023 08:44
Copy link
Contributor

@r-hang r-hang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic looks good to me.

Given the amount of code added in the form of InterfaceFromGoTypesType do you think it makes sense to add some type of test that reads from a checked in archive?

Copy link
Contributor

@JacobOaks JacobOaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple comments. I also agree with @r-hang that we should probably add some tests.

README.md Outdated Show resolved Hide resolved
mockgen/archive.go Outdated Show resolved Hide resolved
mockgen/model/model_gotypes.go Outdated Show resolved Hide resolved
mockgen/model/model_gotypes.go Outdated Show resolved Hide resolved
mockgen/model/model_gotypes.go Outdated Show resolved Hide resolved
mockgen/model/model_gotypes.go Outdated Show resolved Hide resolved
mockgen/model/model_gotypes.go Outdated Show resolved Hide resolved
@sywhang
Copy link
Contributor Author

sywhang commented Dec 5, 2023

Given the amount of code added in the form of InterfaceFromGoTypesType do you think it makes sense to add some type of test that reads from a checked in archive?

Yes, that's a good suggestion. Will make that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants