Smarty

Testing in Go by Example: Part 6

Michael Whatcott
Michael Whatcott
 | 
September 25, 2017
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.
rss feed icon
Subscribe Now
Read our recent posts
Usage notifications | Get notified before hitting your lookup limit
Arrow Icon
Burning the end of a brisket can lead to some tasty results (we’re looking at you, burnt ends), but unexpectedly burning through your lookups? Not so appetizing. All users receive notifications when their API usage reaches 90% and 100%. To help users further leverage their lookups, Smarty’s cooked up a solution: the ability to get notification emails when usage reaches three additional intervals: 25%, 50%, and 70%. With these notifications working alongside usage by key and limit by key, you can manage your API usage better.
Smarty turns FEMA hazard scores into instant, address-level risk intelligence
Arrow Icon
OREM, UT, July 31, 2025—Smarty, a leading address intelligence provider, announced the launch of its US Property Risk Data product. The new API-based solution transforms FEMA’s National Risk Index (NRI) into structured, address-level hazard intelligence, enabling insurers, lenders, and real estate platforms to model risk and evaluate exposure at high speed and massive scale. With the frequency and severity of natural disasters on the rise, insured losses in the US now average over $151 billion annually.
Inside Smarty - Brenyn Beesley
Arrow Icon
Meet Brenyn Beesley, our Business Development Manager. At Smarty, Brenyn has made waves on our Sales team with her exceptional interpersonal skills, ability to take on any organizational and operational challenge, top-notch singing, and all-around awesomeness. Let’s jump right in and get to know Brenyn!Can you explain your role at Smarty to a 10-year-old?“I help my team communicate with people from all kinds of jobs—delivery drivers, real estate agents, insurance workers. We show them how to use Smarty’s tools to find the addresses they need or learn more about a location.

Ready to get started?