I recently saw your video on youtube and it's a cool project.
But I noticed that with how the code is currently setup, it requires the html/css files to be in the proper relative directories compared to the binary to operate.
This PR solves that issue by using //go:embed in order to embed the relevant files directly into the binary during compilation.
So after this change, once you compile the binary you can move it to anywhere on your system and it will run without requiring the html/css files to also be copied.
For reference here is the difference in compiled binary size with and without embedding
Without: 12,810,184 bytes
With: 12,830,008 bytes
Difference: 19,824 bytes
I recently saw your video on youtube and it's a cool project. But I noticed that with how the code is currently setup, it requires the html/css files to be in the proper relative directories compared to the binary to operate.
This PR solves that issue by using
//go:embed
in order to embed the relevant files directly into the binary during compilation. So after this change, once you compile the binary you can move it to anywhere on your system and it will run without requiring the html/css files to also be copied.For reference here is the difference in compiled binary size with and without embedding Without: 12,810,184 bytes With: 12,830,008 bytes Difference: 19,824 bytes