go-statik
brew install go-statik
v0.1.8
Apache-2.0
Embed files into a Go executable
9
30-day installs · #8942
15
90-day · #10567
110
365-day · #8934
3.8k
★ GitHub stars · updated 7mo ago
Build dependencies
GitHub topics
files
go
golang
http
http-server
static
Links
- https://github.com/rakyll/statik
- GitHub: rakyll/statik
- Brew formula source: Formula/g/go-statik.rb
Raw metadata
{
"aliases": [],
"alternatives": [],
"build_dependencies": [
"go"
],
"categories": [],
"caveats": null,
"conflicts_with": [],
"dependencies": [],
"deprecated": 0,
"deprecation_reason": null,
"desc": "Embed files into a Go executable",
"disable_reason": null,
"disabled": 0,
"enrichment_fetched_at": "2026-06-20T23:38:16+00:00",
"first_seen": "2026-06-20T23:34:18+00:00",
"full_name": "go-statik",
"github_default_branch": "master",
"github_last_commit_at": "2026-01-10T21:15:13Z",
"github_readme_excerpt": "# statik\n\n[](https://travis-ci.org/rakyll/statik)\n\nstatik allows you to embed a directory of static files into your Go binary to be later served from an http.FileSystem.\n\nIs this a crazy idea? No, not necessarily. If you\u0027re building a tool that has a Web component, you typically want to serve some images, CSS and JavaScript. You like the comfort of distributing a single binary, so you don\u0027t want to mess with deploying them elsewhere. If your static files are not large in size and will be browsed by a few people, statik is a solution you are looking for.\n\n## Usage\n\nInstall the command line tool first.\n\n\tgo install github.com/rakyll/statik@latest\n\nstatik is a tiny program that reads a directory and generates a source file that contains its contents. The generated source file registers the directory contents to be used by statik file system.\n\nThe command below will walk on the public path and generate a package called `statik` under the current working directory.\n\n $ statik -src=/path/to/your/project/public\n\nThe command below will filter only files on listed extensions.\n\n $ statik -include=*.jpg,*.txt,*.html,*.css,*.js\n\nIn your program, all your need to do is to import the generated package, initialize a new statik file system and serve.\n\n~~~ go\nimport (\n \"github.com/rakyll/statik/fs\"\n\n _ \"./statik\" // TODO: Replace with the absolute import path\n)\n\n // ...\n\n statikFS, err := fs.New()\n if err != nil {\n log.Fatal(err)\n }\n \n // Serve the contents over HTTP.\n http.Handle(\"/public/\", http.StripPrefix(\"/public/\", http.FileServer(statikFS)))\n http.ListenAndServe(\":8080\", nil)\n~~~\n\nVisit http://localhost:8080/public/path/to/file to see your file.\n\nYou can also read the content of a single file:\n\n~~~ go\nimport (\n \"io\"\n\n \"github.com/rakyll/statik/fs\"\n\n _ \"./statik\" // TODO: Replace with the absolute import path\n)\n\n // ...\n\n statikFS, err := fs.New()\n if err != nil {\n log.Fatal(err)\n",
"github_repo": "rakyll/statik",
"github_stars": 3828,
"github_topics": [
"files",
"go",
"golang",
"http",
"http-server",
"static"
],
"homepage": "https://github.com/rakyll/statik",
"homepage_og_description": null,
"homepage_og_image": null,
"homepage_title": null,
"installs_30d": 9,
"installs_365d": 110,
"installs_90d": 15,
"keg_only": 0,
"keg_only_reason": null,
"last_seen": "2026-06-20T23:34:18+00:00",
"license": "Apache-2.0",
"llm_generated_at": null,
"llm_model": null,
"name": "go-statik",
"oldnames": [],
"one_liner": null,
"optional_dependencies": [],
"rank_30d": 8942,
"rank_365d": 8934,
"rank_90d": 10567,
"raw_hash": "05afe81335455eba",
"recommended_dependencies": [],
"revision": 0,
"ruby_source_path": "Formula/g/go-statik.rb",
"tap": "homebrew/core",
"test_dependencies": [],
"uses_from_macos": [],
"version_head": "HEAD",
"version_stable": "0.1.8",
"versioned_formulae": [],
"why_use_this": null
}