I have a model that generates a unique ID (for example, "uuid.V4()") that is not predictable when the test is ran.
I currently work around this by returning an error. For example,
m.EXPECT().
Method(gomock.Any()).
Return(func(v interface{}) {
s, ok := v.(A)
if (s.Foo != "foo1") {
t.Fatal(err)
}
})
If there is a simpler way, I'd like to know.
Why the feature is needed A clear description of how this feature is not
served by existing functionality in gomock.
I could not find the method that does. (correct me if I'm wrong)
(Optional) Proposed solution A clear description of a proposed method for
adding this feature to gomock.
(If there is not a better workaround than what I have now, I can come up with something)
Requested feature A clear description of the desired feature and an example of how it would be used.
Feature Check if a struct A contains at least some parameters of A. Using the example below,
I would like to check if the
Method()
's argument contains at least some required parameters of A.Currently, the below fails because the two instances contain different parameters.
Use Case
I have a model that generates a unique ID (for example, "uuid.V4()") that is not predictable when the test is ran. I currently work around this by returning an error. For example,
If there is a simpler way, I'd like to know.
Why the feature is needed A clear description of how this feature is not served by existing functionality in gomock.
I could not find the method that does. (correct me if I'm wrong)
(Optional) Proposed solution A clear description of a proposed method for adding this feature to gomock.
(If there is not a better workaround than what I have now, I can come up with something)