proxytoworld
V2EX  ›  问与答

golang 在 pkg 中的包有好几个 main,这样子的代码在实际编写的时候怎么测试,如图

  •  
  •   proxytoworld · Apr 30, 2021 · 970 views
    This topic created in 1839 days ago, the information mentioned may be changed or developed.

    在这个仓库中有好几个 main 包里面都有 main.go ,在编写的时候怎么逐个运行 main

    2 replies    2021-04-30 13:40:54 +08:00
    learningman
        1
    learningman  
       Apr 30, 2021 via Android
    goland 加个 target
    Muninn
        2
    Muninn  
       Apr 30, 2021
    一般测试不测试 main 吧,无论单元测试还是集成测试都是单独运行测试的。

    非想一个一个运行 main 用 goland 就可以,用 vscode 你写个 shell 一个一个来就完了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5416 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 09:20 · PVG 17:20 · LAX 02:20 · JFK 05:20
    ♥ Do have faith in what you're doing.