Simple program that embeds target files and/or directories into current directory go package source code. It generates a file containing a function that returns a byte. Files are packed into a tar if more than one file is present, otherwise the file is encoded as is. Intended to be used with go generate.
embed alternatives and similar packages
Based on the "Resource Embedding" category.
Alternatively, view embed alternatives based on common mentions on social networks and blogs.
packr8.8 3.8 embed VS packrThe simple and easy way to embed static files into Go binaries.
statik8.8 0.0 embed VS statikEmbed files into a Go executable
go.rice8.4 0.0 embed VS go.ricego.rice is a Go package that makes working with resources such as html,js,css,images,templates, etc very easy.
vfsgen7.4 0.0 embed VS vfsgenTakes an input http.FileSystem (likely at go generate time) and generates Go code that statically implements it.
fileb0x6.9 0.0 embed VS fileb0xa better customizable tool to embed files in go; also update embedded files remotely without restarting the server
esc6.9 0.0 embed VS escA simple file embedder for Go
go-bindata5.9 0.0 embed VS go-bindataA small utility which generates Go code from any file. Useful for embedding binary data in a Go program.
binclude5.8 7.5 embed VS bincludeInclude files in your binary the easy way
go-resources5.1 0.0 embed VS go-resourcesUnfancy resources embedding for Go with out of box http.FileSystem support.
statics3.3 0.0 embed VS statics:file_folder: Embeds static resources into go files for single binary compilation + works with http.FileSystem + symlinks
go-embed2.6 0.7 embed VS go-embedGenerates go code to embed resource files into your library or executable
templify2.5 1.2 embed VS templifyA tool to be used with 'go generate' to embed external template files into Go code.
rebed2.0 0.0 embed VS rebedRecreates directory and files from embedded filesystem using Go 1.16 embed.FS type.
debme2.0 1.3 embed VS debmeembed.FS wrapper providing additional functionality
mule1.6 1.2 embed VS mulemule is a tool to be used with 'go generate' to embed external resources files into Go code.
gassets0.2 0.0 embed VS gassetsEasy resource bundler for go
Access the most powerful time series database as a service
Do you think we are missing an alternative of embed or a related project?
Simple program that embeds target files and/or directories into current directory go package source code. It generates a file containing a function that returns a byte. Files are packed into a tar if more than one file is present, otherwise the file is encoded as is. This allows targeting prepackaged tar files without specific checks, but means that programs need to be aware if the file is NOT a tar file.
Note that each argument passed to embed is walked, thus you can add multiple directories at once.
To use the data in the program call
bindata(), which returns a byte copy of data. Generally you will then use a tar reader to read it.
Personally I used embed with the
go generate command on a separate sub-package of my intended package and place handling logic for assets there.
embed -h for details.