All assertions are classified into 20 domains to help navigate the API, depending on your use case.
API metrics
Counts for core functionality, and generated variants (formatted, forward, forward-formatted).
Counted for a go1.27 build. Generic assertions gain their forward and forward-formatted variants
(the methods of the Assertions type) from go1.27 on, the first release that accepts type parameters
on methods; on go1.26 those two variants per generic assertion are excluded by their //go:build guard.
Kind
Count
Note
All core functions
145
Maintained core (internal)
All core assertions
140
Usage with *testing.T (per package)
Generic assertions
55
Type-safe assertions (“T” suffix) (per package)
Helpers (not assertions)
5
General-purpose utilities, not assertions (per package)
Others
0
assert/require variants
560
Generated variants
Total assertions variants
1120
Available assertions API
Constructors
2
Builders of Assertion values
Total API surface
1132
All variants, constructors and helpers over all packages
Quick index
Table of core assertions, excluding variants. Each function is side by side with its logical opposite (when available).