V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
d0m2o08
V2EX  ›  Go 编程语言

巨佬,这个 main.go 中没看到 executor 是怎么初始化的呢

  •  
  •   d0m2o08 · 51 天前 · 422 次点击
    这是一个创建于 51 天前的主题,其中的信息可能已经有所发展或是发生改变。

    MetaCubeX/mihomo 这个开源项目,Alpha 分支的 main.go 中,只是引入了"gayhub/metacubex/mihomo/hub/executor"这个包,而且在 executor.go 这个文件中也没看到有 init 方法。

    而在 main.go 中直接就调用了 executor.ApplyConfig 和 executor.Shutdown 方法,

    求巨佬指点一下 executor 这个东西是咋初始化出来的😭

    8 条回复
    zuiwu
        1
    zuiwu  
       51 天前
    你好歹贴个代码 main 文件目录链接啊,啥也没有谁会再自己去搜索帮你看
    iyaozhen
        2
    iyaozhen  
       51 天前
    他又不是个类 class ,为啥要初始化?
    fgwmlhdkkkw
        3
    fgwmlhdkkkw  
       51 天前 via Android
    全局搜下 init
    Constellation39
        4
    Constellation39  
       51 天前
    hub/executor/executor.go
    ```
    package executor
    func ApplyConfig(cfg *config.Config, force bool) {}
    func Shutdown() {}
    ```
    基础语法详见 https://go.dev/doc/
    d0m2o08
        6
    d0m2o08  
    OP
       51 天前
    @iyaozhen 原来是这样,我找错方向了,多谢大佬
    vx7298
        7
    vx7298  
       51 天前
    是不看看 listenser ,,config 哪里有,ReCreateTun ,这个吧
    d0m2o08
        8
    d0m2o08  
    OP
       51 天前
    @vx7298 好的好的,有点眉目了😁
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   4916 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 01:11 · PVG 09:11 · LAX 18:11 · JFK 21:11
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.