replace assets generation with embed (#423)

This commit is contained in:
hulb 2022-05-27 01:36:23 +08:00 committed by GitHub
parent 9397832485
commit 2b1ddd093d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 658 deletions

View file

@ -1,23 +0,0 @@
// +build ignore
package main
import (
"log"
"net/http"
"github.com/shurcooL/vfsgen"
)
func main() {
err := vfsgen.Generate(http.Dir("internal/view"), vfsgen.Options{
Filename: "internal/webserver/assets-prod.go",
PackageName: "webserver",
BuildTags: "!dev",
VariableName: "assets",
})
if err != nil {
log.Fatalln(err)
}
}

6
internal/assets.go Normal file
View file

@ -0,0 +1,6 @@
package internal
import "embed"
//go:embed view
var Assets embed.FS

File diff suppressed because one or more lines are too long