golang / mock

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

fix a little bug of example code #506

Closed bxshcn closed 3 years ago

bxshcn commented 3 years ago

when I tries to make a test of GoMock referring to the example listed in the doc, I always get

--- FAIL: TestMyThing (0.00s) c:\Users\bxshc\Documents\projects\design-pattern\48\busi\busi_test.go:22: Unexpected call to *mock_busi.MockMyInterface.SomeMethod1([4]) at c:/Users/bxshc/Documents/projects/design-pattern/48/busi/mock_busi/mock_busi.go:50 because: expected call at c:/Users/bxshc/Documents/projects/design-pattern/48/busi/busi_test.go:18 doesn't match the argument at index 0. Got: 4 Want: is equal to 4

so I think there maybe something wrong with the type, then I debug it and found that it should specify the exact type of 4 as int64, a pure 4 will result in a type of int.

the change is very simple, just as

thanks!

googlebot commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

bxshcn commented 3 years ago

i'll re-PR with another email.