Get real, active and permanent YouTube subscribers
Get Free YouTube Subscribers, Views and Likes

Testing Error Cases and Failing Early | Go Tests #2

Follow
kubucation

What is failing early and why should you care? Sometimes it doesn't make sense to continue running a test if one of the first assertions already failed. For example if you want to test for the "name" field of a "Post" object, but already identified that your post is nil/null, you're in for trouble. This also becomes relevant when testing for error cases. In this second video of our Golang Testing Series, we're covering both how to test for errors as well as how to abort the execution of a test early if a condition is not met.

posted by Goggabytrobp6