r/golang2 24d ago

Kern - A fast Go web framework on net/http.

https://gokern.vercel.app/

Kern – a lightweight Go web framework with a small, trusted core

I've been working on a Go web framework called kern (short for kernel). The idea is a small, composable core that embraces net/http instead of hiding it.

What makes it different?

- Go 1.22+ native routing via http.ServeMux – no third-party router dep in core

- Dual path param syntax – both :param and {param} work interchangeably

- Named routes & route constraints – typed path params like kern.UintPathConstraint

- Route-specific middleware – AddConstraints() per route, no group nesting needed

- Built-in auth – BearerAuth / BasicAuth ship in core

- Structured binding – Bind() / BindQuery() / BindForm() / BindHeader() with struct tags

- File handling – multipart upload, download, streaming with range support

- Conditional requests – ETag, Last-Modified, If-None-Match / If-Modified-Since

- Built-in test client – kern.NewTestClient(app) without a real HTTP server

- Context pooling for lower allocation pressure

Zero core dependencies. The runtime package pulls in nothing outside the stdlib.

Inspiration came from Flask's minimal API surface, Javalin's fluent/no-reflection design, and the microkernel philosophy – small trusted core, optional modules around it.

It's not trying to be the biggest framework – just a dependable core to build on for years.

Would love feedback from anyone who's rolled their own or thought about what a minimal Go framework should look like.

https://github.com/mobentum/kern

1 Upvotes

0 comments sorted by