Created
August 31, 2021 05:04
-
-
Save icodeface/89aaf03d763c11ed204c1016cca8ac30 to your computer and use it in GitHub Desktop.
context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { | |
select { | |
case <-Ctx.Done(): | |
return | |
default: | |
for i := 0; i < 100; i++ { | |
// 业务逻辑 | |
if err := doSomethingWith(Ctx); err != nil { | |
log.Error(err) | |
break | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment