执行一般命令时不运行init()中内容

This commit is contained in:
GoEdgeLab
2023-03-10 15:14:14 +08:00
parent b0850b6032
commit 35aa55607e
40 changed files with 148 additions and 15 deletions

11
internal/apps/main.go Normal file
View File

@@ -0,0 +1,11 @@
// Copyright 2023 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package apps
import teaconst "github.com/TeaOSLab/EdgeNode/internal/const"
func RunMain(f func()) {
if teaconst.IsMain {
f()
}
}