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

go 中使用协程时定义的 var wt sync.WaitGroup,是否要在整个程序内使用(var Wt sync.WaitGroup),还是一个包定义一个

  •  
  •   proxytoworld · May 2, 2021 · 911 views
    This topic created in 1825 days ago, the information mentioned may be changed or developed.

    我在 sendData 包内定义了一个 WaitGroup,现在在 main 中还要使用 WaitGroup,不知道要不要再定义一个

    1 replies    2021-05-02 22:44:51 +08:00
    Muninn
        1
    Muninn  
       May 2, 2021
    这没有技术上的问题,是个业务逻辑的问题啊。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2401 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 10:43 · PVG 18:43 · LAX 03:43 · JFK 06:43
    ♥ Do have faith in what you're doing.