mirror of
https://github.com/rclone/rclone.git
synced 2024-11-27 10:50:03 +08:00
be8c23f0b4
As more assets are added, using vfsgen makes things a bit easier.
25 lines
454 B
Go
25 lines
454 B
Go
//go:generate go run assets_generate.go
|
|
// The "go:generate" directive compiles static assets by running assets_generate.go
|
|
// +build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/shurcooL/vfsgen"
|
|
)
|
|
|
|
func main() {
|
|
var AssetDir http.FileSystem = http.Dir("./static")
|
|
err := vfsgen.Generate(AssetDir, vfsgen.Options{
|
|
PackageName: "data",
|
|
BuildTags: "!dev",
|
|
VariableName: "Assets",
|
|
})
|
|
if err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
}
|