---
title: "The 9 Go test assertions I use (and why) – Alex Edwards"
url: https://daily.dev/posts/the-9-go-test-assertions-i-use-and-why-alex-edwards-9h4lllsae
source_url: https://www.alexedwards.net/blog/the-9-go-test-assertions-i-use
type: article
source: "Alex Edwards"
published: 2025-08-22T20:03:51.821Z
updated: 2025-08-22T20:04:12.253Z
tags: ["testing", "golang"]
reading_time: 9
upvotes: 9
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The 9 Go test assertions I use (and why) – Alex Edwards

**[Alex Edwards](https://daily.dev/sources/alexedwards)** · 9 min read · 9 upvotes · 0 comments

## Summary

A Go developer shares their preferred set of 9 custom test assertion functions as an alternative to third-party packages like testify/assert. The functions cover basic checks like Equal, NotEqual, True, False, Nil, NotNil, ErrorIs, ErrorAs, and MatchesRegexp. The author argues these minimal helpers provide better developer experience while avoiding the complexity and potential downsides of larger assertion libraries, though acknowledges trade-offs in failure message quality.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.alexedwards.net/blog/the-9-go-test-assertions-i-use>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#golang](https://daily.dev/tags/golang)

[View this post on daily.dev](https://daily.dev/posts/the-9-go-test-assertions-i-use-and-why-alex-edwards-9h4lllsae)
