New 42-day free trialGet it now
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
How address verification helps solve medical billing address fraud
Arrow Icon
Healthcare fraud isn’t just an occasional headache—it’s a $20 billion-a-year black hole draining financial institutions. And that’s just the fraud we know about. As healthcare systems become more complex, fraudsters are also getting smarter, faster, and more creative at exploiting vulnerabilities, especially in address verification. The healthcare industry is an easy target. Medical data can be more valuable than credit card numbers, billing systems are a tangled mess, and the sheer complexity of transactions creates endless opportunities for fraud to slip through unnoticed.
You always need Smarty, unless...
Arrow Icon
We’ll be honest: there are some rare, creative, and oddly inspiring scenarios in which traditional address validation tools—like Smarty—might not be top of mind. Take Gary, for instance. He runs a mail-order sourdough bakery and believes address typos give his shipping process a “personal touch. ” His customers now expect their loaves to go on postal pilgrimages, complete with handwritten notes and breadcrumb trails. Literally. Or Eleanor, who’s lived in the same town for 62 years, ships packages with descriptions like “the blue house with the tire swing near the old Peterson farm.
Why address verification is the necessary complement to autocomplete
Arrow Icon
Address autocomplete is a powerful tool for improving form completions and ensuring users select real, deliverable addresses at entry. However, to maintain long-term data integrity and enhance address-related insights, address verification is a necessary complement. Here’s why:1. Gain up to 55 points of metadata per verified addressAutocomplete provides real-time address suggestions, while address verification appends additional metadata. Address verification enhances each address with up to 55 points of data, such as:ZIP-9 level accuracy geocoordinates (rooftop accuracy also available)ZIP+4 CodesResidential Delivery Indicator (RDI) to identify residential vs.

Ready to get started?