News for hackers. Stuff that matters.
Re:Go 1.22 Release Notes by bheadmaster on Wednesday February 07, 2024 @04:00AM (#39286174)
One example that comes to mind is building a single-binary full-stack application.

You can use whatever frontend framework you want, and just embed the html/css/js/asset files inside the binary with go:embed. In case of dynamic set of files, you can also write a Go utility to generate the embeddings with go:generate.

In addition to the ease of distribution (no more assets/ directory - just a single binary executable!), it also increases speed of the application, as it no longer has to perform file system reads in order to serve a webpage.

Re:Go 1.22 Release Notes by jadayesnaamsi on Wednesday February 07, 2024 @05:41AM (#39286887)
A good example of a Go project using embed to pack its html/css/js assets in a single binary is PocketBase:

https://github.com/pocketbase/pocketbase/blob/master/ui/embe...

Re:Go 1.22 Release Notes by heywire on Wednesday February 07, 2024 @06:59AM (#39287480)
Last I checked, AdGuard Home also did this.

https://github.com/AdguardTeam/AdGuardHome