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.
IntelliJ IDEA 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, refer to the description of Testify on GitHub.
Run
go get -u github.com/stretchr/testify
in the terminal. Alternatively, use the intention action AltEnter to download and install the toolkit.Click the Run test icon
and select Run <configuration>.

note
Ensure that the test file has the _test postfix (for example, testify_test.go).
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.
Thanks for your feedback!