1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vlib/context: some clean up and more readable examples (#9868)

This commit is contained in:
Ulises Jeremias Cornejo Fandos
2021-04-25 06:04:07 -07:00
committed by GitHub
parent 44902b5aba
commit 3c8d2bbaec
5 changed files with 20 additions and 65 deletions

View File

@ -47,7 +47,7 @@ pub fn with_deadline(parent Context, d time.Time) Context {
return Context(ctx)
}
if ctx.err().str() == 'none' {
if ctx.err() is none {
go fn (mut ctx TimerContext, dur time.Duration) {
time.sleep(dur)
ctx.cancel(true, deadline_exceeded)