Using the Testify toolkit
Programming is not always a straightforward process. Especially, when you need to add a small piece of code to an application and ensure that the whole application works as intended. In this case, testing can help you to maintain code quality and improve its reliability.
GoLand supports the Testify toolkit. Testify provides several packages to work with assertions, mock objects, and testing suites. With Testify, you can run your suites and methods as regular test functions. For more information about the toolkit, read the description of Testify on GitHub.
Run tests with Testify
go get -u github.com/stretchr/testifyin the terminal. Alternatively, use the intention action (Alt+Enter) to download and install the toolkit.
Click the Run test icon () and select Run <configuration>.
Compare expected and actual values
You can compare expected and actual values for failed assertion tests.
To see the difference, click the Click to see difference link in the Run pane.