finds.dev← search

// the find

rakyll/statik

★ 3,828 · Go · Apache-2.0 · updated Jan 2026

Embed files into a Go executable

statik is a code-generation tool that packs a directory of static files into a Go source file, which gets compiled into your binary and served via `http.FileSystem`. It predates Go 1.16's `//go:embed` directive by several years. Today, its main audience is anyone stuck on Go 1.15 or below.

Implements `http.FileSystem` correctly, so it drops in anywhere the standard library expects one — no wrapper types needed. The `-m` flag for stripping mtimes is a practical CI fix that most similar tools miss. The generated file is plain Go source, so there's no binary blob in your repo and `go build` handles everything. The example is minimal and actually runnable.

Go 1.16 shipped `//go:embed` as a language feature in 2021, which does everything statik does with zero external tooling and no code generation step — this repo is essentially superseded for anyone on a modern Go version. The build step (run statik, commit the generated file) is fragile in practice: it's easy to forget to re-run it after changing assets, and CI will silently use stale output if you don't wire it into your build. The generated statik.go file is checked into source control as a blob of base64, which pollutes diffs and makes code review annoying. Last meaningful commit activity suggests maintenance is minimal.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →