Re:The Simplicity of Single-File Golang Deployments
by joncfoo on Wednesday March 22, 2023 @10:35AM
(#35261684)
Assets of any kind can be embedded in the executable and accessed via the embed.FS interface. This makes it trivial to bundle up all dependencies if desired.
[ Parent
| on HN ]
Re:The Simplicity of Single-File Golang Deployments
by cytzol on Wednesday March 22, 2023 @01:56PM
(#35264724)
Embedding your assets like this isn't always an improvement. For example, I work on a site with a Go server and static content pages, and I like that I can update one of the pages and see the change instantly without having to re-compile the entire server binary just to get the new files included.
Re:The Simplicity of Single-File Golang Deployments
by mftb on Wednesday March 22, 2023 @10:07PM
(#35269641)
Easy enough to have the app check the regular file system first, then fallback to the embedded fs. You could have the best of both worlds.
Re:The Simplicity of Single-File Golang Deployments
by candiodari on Wednesday March 22, 2023 @06:00PM
(#35267649)
Of course Visual Basic 2.0 and Delphi 1.0 both had embeddable filesystems. Even updateable embedded filesystems (which worked because the exe would really be a zip files. Zip files are indexed from the end of the file. So you can prepend the actual executable code and that would work. Zip files are updateable ...)
I believe after a while you also had sqlite-inside-the-exe things.