










//go:embed logo.png var logoBytes []byte
Create a hard link err := os.Link("original.txt", "hardlink.txt") Check if two files are hard-linked s1, _ := os.Stat("file1.txt") s2, _ := os.Stat("file2.txt") if os.SameFile(s1, s2) fmt.Println("Same file (hard link)")
This is the most common "file link" in modern Go—it links external files into your executable at compile time. Basic usage package main import _ "embed"
//go:embed config.json var configData string
//go:embed templates/*.html var templateFS embed.FS package main import ( "embed" "log" )
//go:generate stringer -type=Pill //go:generate go-bindata -o static.go static/ Run with: