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

29 lines
331 B
V

interface CanPerformTask {
task()
}
struct Task1 {}
fn (task1 Task1) task() {
println('task1')
}
struct Task2 {}
fn (task2 Task2) task() {
println('task2')
}
fn test_go_call_interface_method() {
mut tasks := []CanPerformTask{}
tasks << Task1{}
tasks << Task2{}
for task in tasks {
go task.task()
}
assert true
}