Go tip contains following commmit, that inlines function with single
call bodies.
13baf4b2cd
`(*Call).On()` is the exact target for the improvement in Go repo. Due to
the inlining, assert.CallerInfo() can't not detect the file and line
number of the call to `(*Mock).On()` from `(*Call).On()`. Thus, the test
fails.
Adding the compiler directive `go:noinline` prevent this effect and make
mock package works with go tip as before.
What
===
Add `go.mod` and `go.sum`, using `Go 1.11`.
Why
===
Now that golang/go#24301 has been accepted, lets start using go.mod files
alongside Godep, and keep the two in sync.
Notes
===
There are no changes required to testify to support go.mod. The files were
generated by running `go build` and `go mod tidy.
Merging
===
This PR is intended to be merged after #659 which adds Go1.11 to the list of
supported builds.
The reason is that since the name of the license is not stated
explicitly and the license text differed very slightly I had to perform
a diff to ensure it actually is MIT licensed. Also GitHub does not
detect the license for this project currently (probably for the same
reason).
Changes:
* Remove the line 'Please consider promoting this project...' that is
not part of the MIT license
* Use the same formatting as choosealicense.com
* Explicitly state 'MIT License'
* Update the copyright year
This makes is possible to fail the test instead of panicing in case
that the method was called with unexpected arguments.
Fixes#489
mock: change field 'T' to be private field 'test'
mock_test: MockTestingT not using Mock anymore
Use Go 1.9 t.Helper() to remove testify from the output of the tests and
stop using `\r` to try to overwrite the output.
This means in Go 1.7 and Go 1.8 testify will appear as failing the test.