Unit testing and TDD: 5 of simple tips and tricks for improving your tests
1. Put your tests in a different package
2. Internal tests go in a different file
3. Run all tests on save
4. Write table driven tests
5. Mock things using Go code
https://medium.com/@matryer/5-simple-tips-and-tricks-for-writing-unit-tests-in-golang-619653f90742?source=linkShare-b636419a57de-1516079991
1. Put your tests in a different package
2. Internal tests go in a different file
3. Run all tests on save
4. Write table driven tests
5. Mock things using Go code
https://medium.com/@matryer/5-simple-tips-and-tricks-for-writing-unit-tests-in-golang-619653f90742?source=linkShare-b636419a57de-1516079991
Medium
5 simple tips and tricks for writing unit tests in #golang
Test-driven development is a great way to keep the quality of your code high, while protecting yourself from regression and proving to…
GoLang 1.10 Release notes has been added!
Go 1.10 is not yet released. These are work-in-progress release notes. Go 1.10 is expected to be released in February 2018.
This release:
- caching of built packages;
- adds caching of successful test results;
- runs vet automatically during tests;
- permits passing string values directly between Go and C using cgo.
#golang #news #releases
See more:
https://tip.golang.org/doc/go1.10
Go 1.10 is not yet released. These are work-in-progress release notes. Go 1.10 is expected to be released in February 2018.
This release:
- caching of built packages;
- adds caching of successful test results;
- runs vet automatically during tests;
- permits passing string values directly between Go and C using cgo.
#golang #news #releases
See more:
https://tip.golang.org/doc/go1.10