By onsi
Write expressive, correct Gomega assertions in Go tests using Expect/Ω notation, synchronous and asynchronous (Eventually/Consistently) patterns, the full built-in matcher catalog, composite matchers for nested structs, custom matcher authoring, and sub-libraries for HTTP, streaming I/O, goroutine leak detection, and performance measurement.
Write correct synchronous Gomega assertions — Expect/Ω notation, the To/NotTo/ToNot/Should/ShouldNot equivalences, the multi-return error idiom, Succeed vs HaveOccurred, the .Error() chaining form, annotating assertions (format-string and func()string), tuning failure output via the format subpackage (MaxLength/MaxDepth/UseStringerRepresentation/GomegaStringer/TruncatedDiff/RegisterCustomFormatter/format.Object), and asserting inside helper functions with GinkgoHelper/WithOffset/ExpectWithOffset, NewWithT(t) for plain testing, and the g Gomega callback. Use when writing or reviewing synchronous (non-polling) Gomega assertions.
Polling assertions in Gomega — Eventually (poll until it passes) and Consistently (must keep passing), the func(g Gomega) callback idiom, WithTimeout/WithPolling/Within/ProbeEvery, WithContext and Ginkgo SpecContext, StopTrying/TryAgainAfter bail-outs, MustPassRepeatedly, and default-interval tuning. Use when an assertion can't be true synchronously — anything involving goroutines, channels, network calls, eventual consistency, or "wait until / stays true".
Build compound Gomega assertions by combining matchers — And/SatisfyAll (all pass), Or/SatisfyAny (any pass), Not (negate), WithTransform to map the actual before matching, Satisfy for an ad-hoc predicate, HaveValue to dereference pointers/interfaces, HaveField for struct fields and method results, HaveEach for every element, plus the matchers-as-arguments idiom that lets you nest matchers inside ContainElement/ConsistOf/HaveKeyWithValue/Receive. Use when one Expect needs several requirements at once, or you want to assert deep into a value without writing a custom matcher.
Writing your own Gomega matchers — the GomegaMatcher interface (Match/FailureMessage/NegatedFailureMessage), gcustom.MakeMatcher with message templates and template data, the format package helpers (format.Message/format.Object), MatchMayChangeInTheFuture and StopTrying for Eventually/Consistently, and how to test and package custom matchers. Use when a built-in or composed matcher can't express your domain assertion and you need to build one.
Testing streaming io buffers with gbytes — gbytes.NewBuffer() (an io.Writer also returned by gexec sessions), the Say(regexp) matcher that forward-scans from a moving read cursor, the canonical Eventually(buffer).Should(Say(...)) streaming pattern, sequential cursor-advancing Say calls, Contents(), BufferWithBytes/BufferReader, buffer.Detect for branching, and TimeoutReader/Writer/Closer for testing blocking io.Reader/Writer/Closer. Use when asserting on streaming or incremental output (process stdout/stderr, API streams, io.Readers) rather than a complete value.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.

Jump straight to the docs to learn about Gomega, including a list of all available matchers.
If you have a question, comment, bug report, feature request, etc. please open a GitHub issue.
Gomega ships a set of Claude Code skills as a plugin, so an agent writing assertions in your suite has Gomega's idioms — the full matcher catalog, Eventually/Consistently, and the gstruct/ghttp/gexec/gbytes/gleak/gmeasure sub-libraries — on hand. The Gomega repo doubles as the plugin marketplace, so installation is two commands. From inside Claude Code:
/plugin marketplace add onsi/gomega
/plugin install gomega@gomega
(or non-interactively: claude plugin marketplace add onsi/gomega then claude plugin install gomega@gomega)
This installs a family of gomega:* skills that activate automatically while you write tests. See the docs for the full list.
Learn more about Ginkgo here
A collection of community matchers is available on the wiki.
Gomega is MIT-Licensed
The ConsistOf matcher uses goraph which is embedded in the source to simplify distribution. goraph has an MIT license.
Write, run, and debug Ginkgo/Gomega test suites in Go. Skills for the tree-construction mental model, spec authoring and cleanup, tables and generated specs, the full decorator reference, filtering, parallelism, ordered/flaky specs, timeouts and async, the CLI and CI configuration, reporting, and JSON-first failure diagnosis.
Write fast, stable browser tests with Biloba in your own Ginkgo/Gomega suite. Skills for setup, the dual immediate/matcher API, the XPath DSL, a full API reference, orienting to an unfamiliar page, and debugging failures.
npx claudepluginhub onsi/gomega --plugin gomegaWrite, run, and debug Ginkgo/Gomega test suites in Go. Skills for the tree-construction mental model, spec authoring and cleanup, tables and generated specs, the full decorator reference, filtering, parallelism, ordered/flaky specs, timeouts and async, the CLI and CI configuration, reporting, and JSON-first failure diagnosis.
Write fast, stable browser tests with Biloba in your own Ginkgo/Gomega suite. Skills for setup, the dual immediate/matcher API, the XPath DSL, a full API reference, orienting to an unfamiliar page, and debugging failures.
Go-specific development tools with idiomatic best practices
gopilot is your Go copilot - a skill for writing idiomatic Go code, covering design patterns, error handling, testing, concurrency, generics, and stdlib patterns up to Go 1.26.
Go development following Google Go style guide with Go 1.25+ features and best practices
Go language coding standards, best practices, and testing patterns