Use the //go:embed directive to embed files directly into your Go binary at compile time. Place the directive immediately before a variable declaration to bind the file path to that variable.
package main
import "embed"
//go:embed data.txt
var content string
func main() {
// content now holds the file data
}
This approach compiles the file content into the executable, eliminating the need for external file dependencies at runtime.