wg.Add(3)
go Func1()
go Func2()
go Func3()
}
wg.Wait()
============================
Second one :
for i:= 1 ; i <= 5 ; i++{
wg.Add(1)
go Func1()
wg.Add(1)
go Func2()
wg.Add(1)
go Func3()
}
wg.Wait()
===========================
hey guys . is any diff between these two codes? which one is correct? if both ,which one is standrad ?
There should be no difference
I think first one is more readable and efficient
Обсуждают сегодня