Easy assertion helpers in Go

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

  • This is not too bad but gets a bit repetitive, so people often end up using external assertion libraries like testify. However, for most of my projects I try to avoid external dependencies as much as possible, because I don't want to deal with upgrading them and similar headaches. Today it struck me that the generics (added in Go 1.18) make it easy to write useful assertion helpers without resorting to any libraries. Here's a helper I added to one of my projects today:

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts