knowledgebase/journals/2024_05_14.md
2024-05-16 10:03:01 +02:00

669 B

  • 14:09 quick capture: Hello GPT-4o | OpenAI
  • 14:12 quick capture: GPT-4o
  • Per eseguire un template incluso in un eseguibile #golang (embed)
    • package main
      
      import (
      	"embed"
      	"os"
      	"text/template"
      )
      
      //go:embed templates/*.tmpl
      var templatesFolder embed.FS
      
      func main() {
      	tmpl, err := template.ParseFS(templatesFolder, "templates/*.tmpl")
      	if err != nil {
      		panic(err)
      	}
      	err = tmpl.Execute(os.Stdout, map[string]string{"Name": "Andrea"})
      	if err != nil {
      		panic(err)
      	}
      
      }