Package Usage: go: github.com/mjibson/esc
esc embeds files into go programs and provides http.FileSystem interfaces
to them.
It adds all named files or files recursively under named directories at the
path specified. The output file provides an http.FileSystem interface with
zero dependencies on packages outside the standard library.
Usage:
The flags are:
After producing an output file, the assets may be accessed with the FS()
function, which takes a flag to use local assets instead (for local
development).
FS(Must)?(Byte|String) returns an asset as a (byte slice|string).
FSMust(Byte|String) panics if the asset is not found.
esc can be invoked by go generate:
Embedded assets can be served with HTTP using the http.FileServer.
Assuming you have a directory structure similar to the following:
Where main.go contains:
2 versions
Latest release: over 6 years ago
210 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/mjibson/esc