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 · 918 views
    This topic created in 1827 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   ·   829 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:19 · PVG 04:19 · LAX 13:19 · JFK 16:19
    ♥ Do have faith in what you're doing.