added tips

This commit is contained in:
Mat Ryer 2016-08-29 13:33:28 +01:00
parent 2f4206a8e6
commit eafb1d758c

View File

@ -54,4 +54,10 @@ func CompleteSignUp(to string, sender EmailSender) {
} }
``` ```
The mocked structure implements the interface, where each method calls the associated function field. The mocked structure implements the interface, where each method calls the associated function field.
## Tips
* Keep mocked logic inside the test that is using it
* Only mock the fields you need - it will panic if a nil function gets called
* Use `go:generate` to invoke the `moq` command