BREAKING: USPS slashes address verification to 60 addresses/hour. What 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
Accessibility best practices at Smarty
Arrow Icon
An enterprise-level customer of Smarty’s recently shared how impressed they were with our accessibility-first approach, inquiring about how we designed our tools to function in a way that feels equitable and usable for everyone. At Smarty, one of our core values is outwardness — seeing people as people, not objects or caricatures. Every person who interacts with our tools has their own needs, wants, and objectives, and accessibility is one of the most meaningful ways we connect with people - an area we’re striving to improve.
Introducing Smarty’s mascot… Hermes?
Arrow Icon
Greek gods, as it turns out, have a lot to say to the mortals on Earth and the souls in Hades. What they don’t have is time to travel from Olympus all the way to Earth or Hades just to tell a mere mortal to perform 12 labors… or eat a magical herb… or free Odysseus. That’s why the gods have a personal messenger: Hermes. Equipped with winged sandals, Hermes travels between Olympus, Earth, and the underworld with lightning speed (Get it? Lightning? Because his dad is Zeus? 🤣)Smarty also knows a thing or two about outrageous speed, and that’s not where our similarities with Hermes end.
How to build and validate address lists for direct mail marketing
Arrow Icon
Looking to build a direct mail marketing campaign? You’ve come to the right spot. Before you can send marketing mail like a pro, you’ll need to build a list of verified addresses. Otherwise, frequent misdeliveries and costly redeliveries can take the wind right out of your campaign’s sails. On top of that, a bad address list could lead you to miss out on mind-blowing postal discounts. 😱Don’t let bad addresses capsize your campaign. With a US Master Address List of over 210 million verified addresses—available by state, county, or nationwide—and shipshape US Address Verification, you can construct new lists or clean active ones with the swagger of a seasoned captain.

Ready to get started?