Let's get rid of ugly statik (#2255)

* Get rid of ugly statik

go1.16 introduced the embed package, it's the more graceful solution for embedding file into binary.
https://golang.org/pkg/embed/

* remove statik totally

* split go and static files in assets
This commit is contained in:
bobo liu
2021-08-17 20:20:04 +08:00
committed by GitHub
parent a62a9431b1
commit 2f74f54f18
12 changed files with 43 additions and 77 deletions

View File

@ -124,13 +124,10 @@ func (svr *Service) Run() error {
if svr.cfg.AdminPort != 0 {
// Init admin server assets
err := assets.Load(svr.cfg.AssetsDir)
if err != nil {
return fmt.Errorf("Load assets error: %v", err)
}
assets.Load(svr.cfg.AssetsDir)
address := net.JoinHostPort(svr.cfg.AdminAddr, strconv.Itoa(svr.cfg.AdminPort))
err = svr.RunAdminServer(address)
err := svr.RunAdminServer(address)
if err != nil {
log.Warn("run admin server error: %v", err)
}