split go and static files in assets

This commit is contained in:
bobo liu 2021-08-17 20:03:08 +08:00
parent 2361d62134
commit 58c2e16705
15 changed files with 7 additions and 4 deletions

View File

@ -40,6 +40,9 @@ func Load(path string) {
} }
} }
func Register(fs fs.FS) { func Register(fileSystem fs.FS) {
content = fs subFs, err := fs.Sub(fileSystem, "static")
if err == nil {
content = subFs
}
} }

View File

@ -6,7 +6,7 @@ import (
"github.com/fatedier/frp/assets" "github.com/fatedier/frp/assets"
) )
//go:embed * //go:embed static/*
var content embed.FS var content embed.FS
func init() { func init() {

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -6,7 +6,7 @@ import (
"github.com/fatedier/frp/assets" "github.com/fatedier/frp/assets"
) )
//go:embed * //go:embed static/*
var content embed.FS var content embed.FS
func init() { func init() {

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB