Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(70)

Delta Between Two Patch Sets: 2014/go4java/conc2.go

Issue 111050043: code review 111050043: go.talks: add "Go for Javaneros" (Closed)
Left Patch Set: diff -r c636a8a8316f https://code.google.com/p/go.talks Created 9 years, 8 months ago
Right Patch Set: diff -r f10c43fe60f9 https://code.google.com/p/go.talks Created 9 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
(Both sides are equal)
1 package main 1 package main
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 "time" 5 "time"
6 ) 6 )
7 7
8 func sleepAndTalk(t time.Duration, msg string) { 8 func sleepAndTalk(t time.Duration, msg string) {
9 time.Sleep(t) 9 time.Sleep(t)
10 fmt.Printf("%v ", msg) 10 fmt.Printf("%v ", msg)
11 } 11 }
12 12
13 func main() { 13 func main() {
14 go sleepAndTalk(0*time.Second, "Hello") 14 go sleepAndTalk(0*time.Second, "Hello")
15 go sleepAndTalk(1*time.Second, "Gophers!") 15 go sleepAndTalk(1*time.Second, "Gophers!")
16 go sleepAndTalk(2*time.Second, "What's") 16 go sleepAndTalk(2*time.Second, "What's")
17 go sleepAndTalk(3*time.Second, "up?") 17 go sleepAndTalk(3*time.Second, "up?")
18 } 18 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b