mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 04:22:22 +00:00
20 lines
286 B
Plaintext
Executable File
20 lines
286 B
Plaintext
Executable File
#include <alef.h>
|
|
|
|
void receive(chan(byte*) c) {
|
|
byte *s;
|
|
s = <- c;
|
|
print("%s\n", s);
|
|
terminate(nil);
|
|
}
|
|
|
|
void main(void) {
|
|
chan(byte*) c;
|
|
alloc c;
|
|
proc receive(c);
|
|
task receive(c);
|
|
c <- = "hello proc or task";
|
|
c <- = "hello proc or task";
|
|
print("done\n");
|
|
terminate(nil);
|
|
}
|