Home > other >  The small white consult
The small white consult

Time:10-03

The following code, box red part to write an if ok or to write an if! Ok to run the result is the same, is this why, what is the other 29 exitChan values in the line of code, bosses give advice or comments, thank you

CodePudding user response:

ExitChan to indicate the main thread end waiting, put in true & lt; The data - exitChan was taken, ok=true, exit the loop

If! Ok and if ok certainly is not the same, you probably made a mistake

The standard method and exitChan should be chan struct {}, in order to reduce memory consumption

CodePudding user response:



<- exitChan when unable to remove the data block, don't need to have a dead circulation outside

CodePudding user response:

refer to the second floor and 蘤 old crepe reply:


<- exitChan when unable to remove the data block, don't need to have a dead circulation outside

See, the original can do that, thank you bosses

CodePudding user response:

refer to the second floor and 蘤 old crepe reply:


<- exitChan when unable to remove the data block, don't need to have a dead circulation outside

See, ha ha, thank you very much ~
  • Related