Back to course

Embedding Files in Binaries

Go (Golang) for Cloud-Native Microservices

Static Assets inside Go

Go 1.16 introduced the embed package. You can now include SQL migrations, HTML templates, or config files inside your single binary.

go //go:embed schema.sql var schema string

No more "missing file" errors when deploying to production containers.