V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
proxytoworld
V2EX  ›  问与答

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

  •  
  •   proxytoworld · Apr 30, 2021 · 931 views
    This topic created in 1824 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   ·   3310 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 13:27 · PVG 21:27 · LAX 06:27 · JFK 09:27
    ♥ Do have faith in what you're doing.