Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jandelgado/go1.16-embed-demo

demo of upcoming go 1.16 package "io/fs" and embed features
https://github.com/jandelgado/go1.16-embed-demo

demo embed example fs golang

Last synced: about 1 month ago
JSON representation

demo of upcoming go 1.16 package "io/fs" and embed features

Awesome Lists containing this project

README

        

# Go 1.16 embed.FS and fs.FS demo

Short demo of upcoming go 1.16 "io/fs" package and file embedding feature.

Depending on how the binary is built, either with `dev` build tag or without,
the `assets/` folder will be embedded in the code (without `dev` tag), or the
assets will be read from the filesystem.

Run `make` to build the demo. The `embed-demo` will have the assets folder
compiled-in. The `embed-demo-dev` will use the filesystem to obtain the assets.

See also
* https://tip.golang.org/doc/go1.16#library-embed
* https://go.googlesource.com/proposal/+/master/design/draft-embed.md
* https://go.googlesource.com/proposal/+/master/design/draft-iofs.md

Copyright 2020 by Jan Delgado, License MIT.