https://github.com/koddr/example-embed-static-files-go
The easiest way to embed static files into a binary file in your Golang app (no external dependencies).
https://github.com/koddr/example-embed-static-files-go
tutorial-code tutorial-exercises
Last synced: 2 months ago
JSON representation
The easiest way to embed static files into a binary file in your Golang app (no external dependencies).
- Host: GitHub
- URL: https://github.com/koddr/example-embed-static-files-go
- Owner: koddr
- License: mit
- Created: 2020-01-30T22:01:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-11-08T07:39:45.000Z (about 4 years ago)
- Last Synced: 2025-10-13T14:05:25.306Z (2 months ago)
- Topics: tutorial-code, tutorial-exercises
- Language: Go
- Homepage: https://dev.to/koddr/the-easiest-way-to-embed-static-files-into-a-binary-file-in-your-golang-app-no-external-dependencies-43pc
- Size: 14.6 KB
- Stars: 47
- Watchers: 2
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example for embed static files into a binary
This is full project structure example of article [**The easiest way to embed static files into a binary file in your Golang app (no external dependencies)**](https://dev.to/koddr/the-easiest-way-to-embed-static-files-into-a-binary-file-in-your-golang-app-no-external-dependencies-43pc).
Published on [Dev.to](https://dev.to/koddr/the-easiest-way-to-embed-static-files-into-a-binary-file-in-your-golang-app-no-external-dependencies-43pc) @ 31 Jan 2020.
## Requirements
- Go `1.11+`
- Go Modules
## Usage
- Clone this repository and go to folder:
```console
git clone https://github.com/koddr/example-embed-static-files-go.git
cd example-embed-static-files-go
```
- Install `gosec` (I recommend):
```console
go get github.com/securego/gosec/cmd/gosec
```
- Try to build binary:
```console
make build
```
- No errors? Let's run:
```console
make run
```

- That's all!
## Author
- [Vic Shóstak](https://github.com/koddr) (aka Koddr).
## Article assistance
If you want to say «thank you»:
1. Twit about article [on your Twitter](https://twitter.com/intent/tweet?text=The%20easiest%20way%20to%20embed%20static%20files%20into%20a%20binary%20file%20in%20your%20Golang%20app%20%28no%20external%20dependencies%29%20https%3A%2F%2Fdev.to%2Fkoddr%2Fthe-easiest-way-to-embed-static-files-into-a-binary-file-in-your-golang-app-no-external-dependencies-43pc).
2. Add a GitHub Star and make Fork to this repository.
3. Donate some money to project author via PayPal: [@paypal.me/koddr](https://paypal.me/koddr?locale.x=en_EN) or [LiberaPay](https://liberapay.com/koddr/donate).
4. Join DigitalOcean at our [referral link](https://m.do.co/c/b41859fa9b6e) (your profit is **\$100** and we get \$25).
Thanks for your support! 😘
## License
MIT