cd /news/developer-tools/title-show-hn-assertgo-fluent-assert… · home topics developer-tools article
[ARTICLE · art-39917] src=news.ycombinator.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Title: Show HN: AssertGo – Fluent Assertion Library for Go

A developer released AssertGo, a fluent assertion library for Go inspired by AssertJ, after Go 1.27 added generic methods. The library provides chainable assertions for strings, integers, slices, maps, and types. It is available on GitHub and was built with AI assistance for code generation.

read1 min views1 publishedJun 25, 2026

I like AssertJ-style fluent assertions. I tried to find a library that does that for Go, but couldn't. So I wrote my own some time ago, but I didn't quite like it. A few days ago I heard about Go 1.27 and the addition of generic methods, so I gave it another try.

I like the way it came out this time. Most of the code was written with 1.26. Just now, after the 1.27 RC release, I changed the top-level methods to be generic - previously they were any.

As for the AI: I used Claude Sonnet, but as a codegen more than anything else. All the design choices are mine, and everything is done in small, incremental commits.

https://github.com/sku0x20/assertgo

Some examples:

    T(t).Assert("hello").EqualTo("hello")
    T(t).AssertInt(10).GreaterThan(5)
    T(t).AssertSlice([]int{1, 2, 3}).ContainsAll([]int{1, 3})
    T(t).AssertMap(map[string]int{"a": 1}).HasLength(1)
    T(t).AssertType(42).Is[int]()

Comments URL: https://news.ycombinator.com/item?id=48678760

Points: 1

── more in #developer-tools 4 stories · sorted by recency
── more on @assertgo 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/title-show-hn-assert…] indexed:0 read:1min 2026-06-25 ·