Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jandelgado/go1.16-embed-demo
- Owner: jandelgado
- Created: 2020-12-18T23:45:29.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-19T15:16:50.000Z (almost 4 years ago)
- Last Synced: 2023-02-26T23:22:48.429Z (over 1 year ago)
- Topics: demo, embed, example, fs, golang
- Language: Go
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.mdCopyright 2020 by Jan Delgado, License MIT.