✏️ 修复 webgui 无法启动

This commit is contained in:
fumiama
2021-11-09 13:01:01 +08:00
parent 34bc8e3a3c
commit e2032cdc74
3 changed files with 12 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
package web
package webctrl
import (
"encoding/json"
@@ -36,8 +36,8 @@ var (
type logWriter struct {
}
// initGui 初始化gui
func initGui() {
// InitGui 初始化gui
func InitGui() {
// 将日志重定向到前端hook
writer := io.MultiWriter(l, os.Stderr)
log.SetOutput(writer)

View File

@@ -1,11 +0,0 @@
// Package web 网页管理后端
package web
import "flag"
func init() {
// 解析命令行参数,输入 `-g` 即可启用 gui
if *flag.Bool("g", false, "Enable web gui.") {
initGui()
}
}