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

context: add a new context module, based on Golang's context, intended to be used in webservers (#9563)

This commit is contained in:
Ulises Jeremias Cornejo Fandos
2021-04-12 13:32:51 -03:00
committed by GitHub
parent b54188dfea
commit 07a6f4e445
10 changed files with 778 additions and 1 deletions

19
vlib/context/empty_test.v Normal file
View File

@@ -0,0 +1,19 @@
module context
fn test_background() {
ctx := background()
assert 'context.Background' == ctx.str()
if _ := ctx.value('') {
println('This should not happen')
assert false
}
}
fn test_todo() {
ctx := todo()
assert 'context.TODO' == ctx.str()
if _ := ctx.value('') {
println('This should not happen')
assert false
}
}