• Nergens vindt u een betere deal!
  • 14 Dagen retour garantie
  • Webwinkelkeur - Veilig en Betrouwbaar

Go File Links ((new)) 💯 Best

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:generate stringer -type=Pill //go:generate go-bindata -o static.go static/ Run with: go file links

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

//go:embed templates/*.html var templateFS embed.FS package main import ( "embed" "log" ) _ := os.Stat("file1.txt") s2

//go:embed config.json var configData string

func main() data, _ := staticFiles.ReadFile("static/style.css") log.Println(string(data))

//go:embed logo.png var logoBytes []byte

Proefabonnementen

Informatie

Voorwaarden

Contact