mirror of
https://github.com/chainreactors/spray.git
synced 2026-10-28 19:40:49 +00:00
- go:generate now uses -embed flag to produce //go:embed binary data - templates.go reduced from 125KB base64 source to 0.9KB + 93KB .bin files - binary saves ~28KB (removes base64 decode overhead at runtime) - templates submodule updated with embed-aware generator Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
28 lines
677 B
Go
28 lines
677 B
Go
//go:generate go run templates/templates_gen.go -t templates -o pkg/templates.go -need spray -embed
|
|
package main
|
|
|
|
import (
|
|
"github.com/chainreactors/spray/cmd"
|
|
"github.com/gookit/config/v2"
|
|
"github.com/gookit/config/v2/yaml"
|
|
//_ "net/http/pprof"
|
|
)
|
|
|
|
func init() {
|
|
config.WithOptions(func(opt *config.Options) {
|
|
opt.DecoderConfig.TagName = "config"
|
|
opt.ParseDefault = true
|
|
})
|
|
config.AddDriver(yaml.Driver)
|
|
}
|
|
|
|
func main() {
|
|
// 启动 pprof HTTP 服务器,用于调试 goroutine 泄露等问题
|
|
//go func() {
|
|
// // 仅监听本地 6060 端口,避免对外暴露
|
|
// _ = http.ListenAndServe("127.0.0.1:6060", nil)
|
|
//}()
|
|
|
|
cmd.Spray()
|
|
}
|