The simple and easy way to embed static files into Go binaries.

Packr is a simple solution for bundling static assets inside of Go binaries.

Installation

Usage

A box represents a folder, and any sub-folders, on disk that you want to have access to in your binary. When compiling a binary using the packr CLI the contents of the folder will be converted into Go files that can be compiled inside of a „standard“ go binary. Inside of the compiled binary the files will be read from memory. When working locally the files will be read directly off of disk.

Usage with HTTP

Building a Binary

Publikováno v Go