mirror of
https://github.com/vbatts/talks.git
synced 2025-05-24 13:52:30 +00:00
symlinks to save space
from `go get github.com/vbatts/freezing-octo-hipster/cmd/dups` I ran `dups -s .` Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
5329804f93
commit
6c96557cc6
34 changed files with 24 additions and 598 deletions
|
@ -1,33 +0,0 @@
|
|||
// +build OMIT
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
// STARTMAIN1 OMIT
|
||||
type Ball struct{ hits int }
|
||||
|
||||
func main() {
|
||||
table := make(chan *Ball)
|
||||
go player("ping", table)
|
||||
go player("pong", table)
|
||||
|
||||
table <- new(Ball) // game on; toss the ball
|
||||
time.Sleep(1 * time.Second)
|
||||
<-table // game over; grab the ball
|
||||
}
|
||||
|
||||
func player(name string, table chan *Ball) {
|
||||
for {
|
||||
ball := <-table
|
||||
ball.hits++
|
||||
fmt.Println(name, ball.hits)
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
table <- ball
|
||||
}
|
||||
}
|
||||
|
||||
// STOPMAIN1 OMIT
|
1
2015/06-devnation-golang-good-bad-ugly/pingpong.go
Symbolic link
1
2015/06-devnation-golang-good-bad-ugly/pingpong.go
Symbolic link
|
@ -0,0 +1 @@
|
|||
../02-devconf.cz/pingpong.go
|
Loading…
Add table
Add a link
Reference in a new issue