New 42-day free trial Get it now
Smarty

Testing in Go by Example: Part 6

Smarty header pin graphic
Updated October 29, 2025
Tags
Smarty header pin graphic

For this installment of the Testing in Go series we'll be talking about a grouping of packages that facilitate general-purpose comparisons in various contexts. Since the most common context is testing it seemed like this series was the right place for the discussion.

We generally refer to these comparison functions as assertions (cue ominous background music and spooky sound effects). You may have already read the opinions found on the Golang FAQ related to assertions.

"Why does Go not have assertions?"

Go doesn't provide assertions. They are undeniably convenient, but our experience has been that programmers use them as a crutch to avoid thinking about proper error handling and reporting. Proper error handling means that servers continue operation after non-fatal errors instead of crashing...

"Where is my favorite helper function for testing?"

Go's standard testing package makes it easy to write unit tests, but it lacks features provided in other language's testing frameworks such as assertion functions. An earlier section of this document explained why Go doesn't have assertions, and the same arguments apply to the use of assert in tests.

In general, we agree that in many scenarios, a single assertion failure shouldn't prevent a test from running. So, by default, the assertion functions we use don't do that. Problem solved.

Subscribe to our blog!
Learn more about RSS feeds here.
Read our recent posts
What to look for in an address data solution: Ease of implementation
Arrow Icon
You’ve maybe chosen an address data provider (or maybe you’ve just recently fallen out of love with the one you’ve got). Now comes the time to really test what matters: implementation. Even the best solution falls short if it’s hard to integrate, confusing to use, or impossible to maintain. This blog is part of our five-part series, What to look for in an address data solution. Previously, we discussed why human support teams should be top of mind when choosing an address data solution. Not just tech support, but educational materials, help getting started, and more.
What to look for in an address data solution: Quality of support
Arrow Icon
Selecting the right address data solution is only the beginning. Rolling it out successfully, resolving issues quickly, and keeping it performing at its best all depend on the quality of support behind it. This blog is part of our five-part series, What to look for in an address data solution. Previously, we discussed what it means to be accurate, what questions to ask any address data provider before entering into a contract with them, and how to avoid the accuracy “validation gap. ”Today, we’re focusing on an often-overlooked element: a supportive, accessible, and responsive partner.
What to look for in an address data solution: Data accuracy
Arrow Icon
Once you know what capabilities you need, the next challenge is choosing a provider that actually delivers—pun intended. This blog is part of our five-part series, What to look for in an address data solution. Previously, we discussed the need to find an address data solution that understands the importance of speed, scalability, and reliability, enabling you to maintain automated, efficient, and accurate workflows in any industry that deals with addresses. Today, we’ll focus on the hidden costs of inaccurate data, defining and combating the “validation gap”, and why it’s important in any industry.

Ready to get started?