first commit

This commit is contained in:
2021-09-14 19:02:40 +00:00
commit 6dc292e989
4 changed files with 55 additions and 0 deletions

26
fs-demo.go Normal file
View File

@ -0,0 +1,26 @@
package main
import (
"embed"
"fmt"
"html/template"
"os"
)
//go:embed assets/*
var assetData embed.FS
func main() {
t, err := template.ParseFS(assetData, "assets/report.html")
if err != nil {
fmt.Println(err)
}
templateData := struct {
Title string
}{
Title: "File inside Go",
}
t.Execute(os.Stdout, templateData)
}